You may encounter a memory leak, and a System.ComponentModel.Win32Exception exception may occur if you create several hundred XML Paper Specifications (XPS) in a Windows Presentation Foundation application

Article translations Article translations
Article ID: 942443 - View products that this article applies to.
This article has been archived. It is offered "as is" and will no longer be updated.
Expand all | Collapse all


If you create several hundred XML Paper Specifications (XPS) in one batch in a Microsoft Windows Presentation Foundation application, you may encounter a memory leak in the event handler. Additionally, a System.ComponentModel.Win32Exception exception may occur.


To work around this problem, preload the PresentationCore.dll file or the PresentationFramework.dll file in the primary application domain. Preload the file before the secondary application domain runs any Windows Presentation Foundation code. This operation adds the natively generated images into memory. Additionally, this operation prevents the problem.


Article ID: 942443 - Last Review: October 26, 2013 - Revision: 2.0
Applies to
  • Microsoft .NET Framework 3.0
kbnosurvey kbarchive kbexpertiseadvanced kbtshoot kbprb KB942443

Give Feedback


Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from