question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OpenXmlPackage.SaveAs() corrupts file names

See original GitHub issue

Describe the bug OpenXmlPackage.SaveAs() corrupts names of the internal package files.

To Reproduce Steps to reproduce the behavior:

base.pptx

using var pres = PresentationDocument.Open("base.pptx", true);
var savedAs = pres.SaveAs("modified.pptx");
savedAs.Close();

Observed behavior The following renaming happened:

/ppt/slides/slide1.xml -> /ppt/slides/slide12.xml /ppt/slides/slide2.xml -> /ppt/slides/slide21.xml

image

Expected behavior The original names of /ppt/slides/slide1.xml and slide2.xml should not be changed.

Desktop:

  • OS: Windows 10
  • .NET Target: .NET 6
  • DocumentFormat.OpenXml Version: 2.17.1

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
hunyucommented, Aug 29, 2022

@adamshakhabov Thank you very much for the information. I am able to repro the issue your described using 2.17.1. I will take the issue back to our engineering team, and we will let you know the resolution.

0reactions
hunyucommented, Oct 14, 2022

Hi Adamshakhabov

We traced the issue back, where appending extra sequence number was introduced with Openxml SDK 2.9, and the issue does not repro with 2.8.1 and prior. It impacted not only PowerPoint, but other Office apps as well. No ETA, yet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

OpenXmlPackage.SaveAs() corrupts file names #1197
Describe the bug OpenXmlPackage.SaveAs() corrupts names of the internal package files. To Reproduce Steps to reproduce the behavior: ...
Read more >
c# - OpenXml SpreadsheetDocument SaveAs() produces ...
This dead-simple code creates a file that Excel won't open. How could this be failing? using (SpreadsheetDocument doc = SpreadsheetDocument.Open ...
Read more >
File getting corrupted while adding comments to excel ...
Hello, Below link provided me the working code to add comments to an excel using Open Xml. This worked perfect for the excel...
Read more >
VBA saveas causing corruption
Hi Looking at the code, it seems to be trying to open the file that is referenced in cell B15, and then saving...
Read more >
How to diagnose Excel file corruption and repair workbooks
During workbook save, Office will detect, if image relationships in the customUI XML part have been corrupted inside an OpenXML file.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found