We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This is almost a duplicate of #1636 but about PowerPoint and with clear repro steps and a sample document.
Describe the bug
Unhandled exception. System.ObjectDisposedException: Cannot access a disposed object. Object name: 'System.IO.Compression.DeflateStream'. at System.IO.Compression.DeflateStream.ReadCore(Span`1 buffer) at System.IO.Packaging.ZipWrappingStream.Read(Span`1 buffer) at System.IO.Stream.ReadAtLeastCore(Span`1 buffer, Int32 minimumBytes, Boolean throwOnEndOfStream) at System.IO.Stream.ReadAtLeast(Span`1 buffer, Int32 minimumBytes, Boolean throwOnEndOfStream) at System.Xml.XmlTextReaderImpl.InitStreamInput(Uri baseUri, String baseUriStr, Stream stream, Byte[] bytes, Int32 byteCount, Encoding encoding) at System.Xml.XmlTextReaderImpl.FinishInitStream() at System.Xml.XmlTextReaderImpl..ctor(Stream stream, Byte[] bytes, Int32 byteCount, XmlReaderSettings settings, Uri baseUri, String baseUriStr, XmlParserContext context, Boolean cl oseInput) at System.Xml.XmlReaderSettings.CreateReader(Stream input, Uri baseUri, String baseUriString, XmlParserContext inputContext) at DocumentFormat.OpenXml.XmlConvertingReaderFactory.Create(Stream partStream, IOpenXmlNamespaceResolver resolver, XmlReaderSettings settings, Boolean strictRelationshipFound) at DocumentFormat.OpenXml.OpenXmlPartRootElement.LoadFromPart(OpenXmlPart openXmlPart, Stream partStream) at DocumentFormat.OpenXml.Packaging.OpenXmlPart.LoadDomTree[T]() at DocumentFormat.OpenXml.Packaging.PresentationPart.get_Presentation() at Program.<Main>$(String[] args) in /Users/Sergey_Tihon/git/oxml-malformedurl-url/Program.cs:line 7
To Reproduce
dotnet run
using DocumentFormat.OpenXml.Packaging; using var fs = File.Open("repro.pptx", FileMode.Open, FileAccess.Read); var openSettings = new OpenSettings { AutoSave = false }; using var doc = PresentationDocument.Open(fs, false, openSettings); var presentation = doc.PresentationPart!.Presentation!; var slideIds = presentation.SlideIdList?.ChildElements; Console.WriteLine(slideIds?.Count ?? -1);
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>net8.0</TargetFramework> <RootNamespace>oxml_malformedurl_url</RootNamespace> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> </PropertyGroup> <ItemGroup> <PackageReference Include="DocumentFormat.OpenXml" Version="3.1.0" /> </ItemGroup> </Project>
Observed behavior
Cannot access a disposed object. Object name: 'System.IO.Compression.DeflateStream'.
Expected behavior
Fully functional recovered document.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered:
The issue here is that the underlying streams get reloaded when loading a part - I have a "quick" fix that I'll follow with a better one
Sorry, something went wrong.
Get strict relationship status before opening stream
a407b9f
Fixes #1802
a91483f
twsouthwick
Successfully merging a pull request may close this issue.
This is almost a duplicate of #1636 but about PowerPoint and with clear repro steps and a sample document.
Describe the bug
To Reproduce
dotnet run
Observed behavior
Cannot access a disposed object.
Object name: 'System.IO.Compression.DeflateStream'.
Expected behavior
Fully functional recovered document.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: