Announcing the Release of a New System.IO.Packaging Implementation

The Open XML SDK is based on the classes in the System.IO.Packaging namespace, so if there is a bug in System.IO.Packaging, then that bug is also in the Open XML SDK.

Well, there is a bad bug in System.IO.Packaging, which causes it in some cases to throw spurious ObjectDisposedException and NullReferenceException when used in a Web front end with Open XML functionality implemented using the Open XML SDK.  The gist of this bug is that if internal memory usage of System.IO.Packaging goes above a threshold of 10MB, then System.IO.Packaging uses System.IO.IsolatedStorage, which malfunctions if two executables or threads simultaneously attempt to access it.  This occurs when IsolatedStorage is used from multiple exes with the same strong name (as we will have with multiple web front end applications) or from a high-performance multi-threaded Open XML applications.

To solve this issue, I have developed a new implementation of System.IO.Packaging, which is based on System.IO.Compression, and which does not use System.IO.IsolatedStorage.  This new module, open sourced under the MIT license, is becoming part of COREFX, the awesome, new open source implementation of the .NET framework.  I have included it in the Open XML SDK, and provided a Visual Studio solution that enables you to build the Open XML SDK along with this new module.

The following screen-cast explains the bug and the fix, shows how to git and use the Open XML SDK that includes the new System.IO.Packaging, and discusses how I developed it.