You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi everyone, we faced an issue after "DocumentFormat.OpenXml" migration from 2.20.0 to latest 3.1.0 (issue reproduces in versions 3.0.0 - 3.1.0).
It happens on disposal of WordprocessingDocument Stacktrace: - System.IO.IOException: Entries cannot be opened multiple times in Update mode. at System.IO.Compression.ZipArchiveEntry.OpenInUpdateMode() at System.IO.Packaging.ZipStreamManager.Open(ZipArchiveEntry zipArchiveEntry, FileAccess streamFileAccess) at System.IO.Packaging.ZipPackagePart.GetStreamCore(FileMode streamFileMode, FileAccess streamFileAccess) at DocumentFormat.OpenXml.Packaging.OpenXmlPart.LoadDomTree[T]() at DocumentFormat.OpenXml.Packaging.MainDocumentPart.get_PartRootElement() at DocumentFormat.OpenXml.Packaging.OpenXmlPackage.SavePartContents(Boolean save) at DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Dispose(Boolean disposing) at DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Dispose() at Edocs.Infrastructure.Services.Conversion.OpenXMLCorrector.FixSharePointFile(MemoryStream stream, IFileLoggerInfo fileLoggerInfo, String extension)
Issue reproduces only with particular .docx file: File.docx
Hi @Yaroslav-Andrieiev-Net
The error you are seeing occurs when code tries to open stream when another stream is open. I recommend using using statement whenever possible to avoid handling all the stream. See this issue[(https://github.com//issues/909))]
To be able to troubleshoot your issue could you please provide the following so I can test it on my site and check for errors:
Whole class including extension method as there are variables in your code like:
this.PrefixResolver(prefix,namespaceManager);
that I am not able to resolve. Also please hardcode all the constants or provide constants class
EdocsConversionConstant
Possibly issue maybe somewhere in the extension methods as you are opening streams there but without working example I am not able to tell for sure.
Describe the bug
Hi everyone, we faced an issue after "DocumentFormat.OpenXml" migration from 2.20.0 to latest 3.1.0 (issue reproduces in versions 3.0.0 - 3.1.0).
It happens on disposal of WordprocessingDocument
Stacktrace:
- System.IO.IOException: Entries cannot be opened multiple times in Update mode. at System.IO.Compression.ZipArchiveEntry.OpenInUpdateMode() at System.IO.Packaging.ZipStreamManager.Open(ZipArchiveEntry zipArchiveEntry, FileAccess streamFileAccess) at System.IO.Packaging.ZipPackagePart.GetStreamCore(FileMode streamFileMode, FileAccess streamFileAccess) at DocumentFormat.OpenXml.Packaging.OpenXmlPart.LoadDomTree[T]() at DocumentFormat.OpenXml.Packaging.MainDocumentPart.get_PartRootElement() at DocumentFormat.OpenXml.Packaging.OpenXmlPackage.SavePartContents(Boolean save) at DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Dispose(Boolean disposing) at DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Dispose() at Edocs.Infrastructure.Services.Conversion.OpenXMLCorrector.FixSharePointFile(MemoryStream stream, IFileLoggerInfo fileLoggerInfo, String extension)
Issue reproduces only with particular .docx file: File.docx
Code
Extenstion methods:
Thanks in advance for any assistance!
The text was updated successfully, but these errors were encountered: