New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Workbook with custom properties becomes corrupt #506
Comments
I strongly suspect that this is a bug in |
@igitur Thanks for the report. It doesn't seem to bother 2016 so I'll have to test with 2013 when I get a chance. I notice that there are some validation errors but not sure if those would affect. |
Do you see the same repro with |
Also, can you give it a try with 2.9.0? It's available in the CI feed and I've fixed a number of weird design issues within the validator in 2.9.0, so the architecture of the validator is substantially different now. |
Not sure if this is just a repro and you have a larger scenario, but you should be able to open it in read only (ie pass |
Thanks, but unfortunately it's not an option. He code sample is just a reduced test case. I'll try the other suggestions soon. Will also try to remove the validation errors. In the original, non-minimal use case there are no validation errors. Something must have happened when I trimmed down the Excel file. |
I updated the test case. The validation errors are removed (they were related to comments). I have added both the input file and the file produced (i.e. after modification), and their hashes. This is still with |
Downgrading |
Hunting down the cause of the CRC error is probably easier than trying to set up a machine with Excel 2013 ;-) |
I found the file is changed even without any validation checks. Can you check if it occurs if you just open and close a package with |
Yes, the error occurs with this code too: using (var package = System.IO.Packaging.Package.Open(sourcePath, FileMode.Open))
{
foreach (var p in package.GetParts())
Console.WriteLine(p.Uri);
} Should I report this issue at https://github.com/dotnet/core/issues ? Having the OpenXml team's weight behind it will surely help :-) |
This should probably be reported to https://github.com/dotnet/corefx/issues. Does it repro without doing the writeline? |
The zip implementation is completely different between .NET Framework and .NET Core, so seems like there may be an issue in that implementation. |
Yes, it repros without the writelines too. Ok, I'll report it. Thanks. |
Any progress on this? 6 months and the dotnet core team hasn't even started looking at it. This should be top priority. It is a blocking issue with no workaround and prevents modifying Excel files in .NET Core. |
@orobert91 The issue is not in this SDK but in the .NET Core implementation. We're blocked here until there is progress there. |
Looks like this has been fixed in System.IO.Packaging (see dotnet/corefx#37079). We've updated to the latest version, so should be fixed. I'll close the issue here, but please reopen if issue persists. |
Description
Using OpenXML to purely open and save a file (without any manipulation) causes a corrupt file, i.e. Excel 2013 64b complains:
Note that the file contains custom property parts, some of which are of 0 lengths. I don't have control of those parts.
This problem occurs only when using .NET Core, not with .NET Framework.
Information
Repro
Input file:
MD5 hashes:
Observed
file_to_open.xlsx
becomes corrupt.Expected
file_to_open.xlsx
remains readable by Excel.The text was updated successfully, but these errors were encountered: