Opening XPS document in .Net causes a memory leak
Well, I found it. It IS a bug in the framework and to work around it you add a call to UpdateLayout. Using statement can be changed to the following to provide a fix; Using XPSItem As New Windows.Xps.Packaging.XpsDocument(PathToTestXps, System.IO.FileAccess.Read) Dim FixedDocSequence As Windows.Documents.FixedDocumentSequence Dim DocPager As Windows.Documents.DocumentPaginator FixedDocSequence = XPSItem.GetFixedDocumentSequence DocPager = FixedDocSequence.DocumentPaginator DocPager.ComputePageCount() … Read more