Comments (5)
thanks for the response - I'll take a look
from open-xml-sdk.
I'm seeing this as well.
Opening the file myself and passing the stream into WordprocessingDocument.Open instead of the path might be a work around.
from open-xml-sdk.
I believe this has been fixed in 3.0.2. Please reopen if you're still seeing this
from open-xml-sdk.
If I do something like this
static void Main(string[] args)
{
try
{
using var doc = WordprocessingDocument.Open(@"S:\test\WIDE.doc", false);
}
catch
{
using var file = File.Open(@"S:\test\WIDE.doc", FileMode.Open, FileAccess.Read);
}
}
On .NET 8.0 then the call to Open
throws System.IO.FileFormatException
with the message "File contains corrupted data." and then the call to File.Open
fails because the file is still locked - doesn't seem right?
Debugging it, it looks like the call to Package.Open
at
(I don't have an option to reopen the issue myself)
from open-xml-sdk.
Hello,
I am still experiencing this issue on version 3.0.2 and I am unable to reopen the issue.
Here is a sample code:
using DocumentFormat.OpenXml.Packaging;
Console.WriteLine("Hello, World!");
WordprocessingDocument wDoc = null;
try
{
wDoc = WordprocessingDocument.Open(@"...\corruptedFile.docx", true);
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
finally
{
wDoc?.Dispose();
}
Console.ReadKey();
With this code, the file remains locked by the console until it is shut down.
Thanks.
from open-xml-sdk.
Related Issues (20)
- Documentation Request: Explain how to "Splitting up (shredding) a file into multiple files, and combining multiple files into a single file." HOT 1
- I am using the OpenXML SDK to read the PPT template for content replacement. After stress testing, I found that the memory usage is too high and the number of Gen0, Gen1, and Gen2 object collections is too frequent. HOT 5
- DocumentFormat.OpenXml.Office2016.Drawing.Charts.UniqueID creates the wrong case in the resulting XML
- Add c16:uniqueId for CT_DPt and CT_LegendEntry
- `pictureOptions` and `bubble3D` were removed from some complex types in O15 but not the SDK
- Performance degradation for WordprocessingDocument (v3.1.0 vs v2.20.0 vs v2.5.0) HOT 1
- Calling Worksheet.Save() makes rest of changes to worksheet not apply in 3.1 HOT 3
- Some source files use <remark> tags rather than <remarks> in their documentation comments
- Bug with Open XML SDK
- EndnotesPart.AddHyperlinkRelationship not generating proper endnotes.xml.rels
- Open XML SDK bug?
- Unable to Create Custom Icon Set for Conditional Formatting
- Office2010.Excel - ConditionalFormatting example
- Bug with Open XML SDK HOT 1
- Cloning sheet doesn't clone Drawing part
- A basic OpenXml created Workbook breaks in 'Spreadsheet Compare'
- External hyperlinks (`Relationship`) with a space character within its address breaks Excel 2007. HOT 1
- Rich text support in power point
- FontName becomes OpenXmlUnknownElement
- Adding CellFormula - on opening with Excel, @ have been injected. How to avoid?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from open-xml-sdk.