Skip to content

Bug with opening corrupted Open XML documents #1681

Closed
@BenjaminLopVic

Description

@BenjaminLopVic

Describe the bug
Opening a corrupted document lock the file.

To Reproduce
Steps to reproduce the behavior:

  1. Simulate a corrupted file (simply create a txt file with content in it and change the extension to .docx)
  2. Try opening the file with WordProcessingDocument.Open(...)

Observed behavior
The method WordProcessingDocument.Open(...) throws an exception, stating that the file is corrupted but keeps the file locked to. This can be verified using tools like "File Locksmith."

Expected behavior
Continue throwing the exception but release the file before.

Desktop

  • OS: Windows 11
  • .NET Target: .NET Framework 4.8
  • DocumentFormat.OpenXml Version: 3.0.1

Thanks.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions