Skip to content

.NET core WPF print dialog freeze/not supported exception #2609

@Zubastic

Description

@Zubastic
  • .NET Core Version: 3.1.101, 3.1.102
  • Windows version: 1607 14393.3504
  • Does the bug reproduce also in WPF for .NET Framework 4.8?: No
  • Is this bug related specifically to tooling in Visual Studio (e.g. XAML Designer, Code editing, etc...)? No

Problem description:
After select print button error appears.

Actual behavior:
NotSupportedException when I selected virtual printer (for example Microsoft Print to PDF). When selected in dialog real one - nothing happends, just app became unresponsible for infinity time. At debugger it stuck at WaitHandle:

изображение

System.NotSupportedException: Specified method is not supported.
   at MS.Internal.PrintWin32Thunk.XpsPrintJobStream.Seek(Int64 offset, SeekOrigin origin)
   at System.Printing.PrintQueueStream.Seek(Int64 offset, SeekOrigin origin)
   at System.IO.Compression.ZipArchive.WriteFile()
   at System.IO.Compression.ZipArchive.Dispose(Boolean disposing)
   at System.IO.Compression.ZipArchive.Dispose()
   at System.IO.Packaging.ZipPackage.Dispose(Boolean disposing)
   at System.IO.Packaging.Package.System.IDisposable.Dispose()
   at System.IO.Packaging.Package.Close()
   at System.Windows.Xps.Packaging.XpsDocument.DisposeXpsDocument()
   at System.Printing.PrintQueue.DisposeSerializationManager(Boolean abort)
   at System.Windows.Xps.XpsDocumentWriter.EndWrite(Boolean disposeManager, Boolean abort)
   at System.Windows.Xps.XpsDocumentWriter.SaveAsXaml(Object serializedObject, Boolean isSync)
   at System.Windows.Xps.XpsDocumentWriter.Write(DocumentPaginator documentPaginator, PrintTicket printTicket)
   at System.Windows.Controls.PrintDialog.PrintDocument(DocumentPaginator documentPaginator, String description)
   at WpfNetcoreTest.Program..ctor() in C:\Users\Zubastic\Source\Repos\Zubastic\PrintDialogBug\WpfNetcoreTest\Program.cs:line 18
   at WpfNetcoreTest.App..ctor() in C:\Users\Zubastic\Source\Repos\Zubastic\PrintDialogBug\WpfNetcoreTest\App.xaml.cs:line 18
   at WpfNetcoreTest.App.Main()

Expected behavior:
I could print PDF document at printer/save pdf file.

Minimal repro:
Repo for reproduce bug:
https://github.com/Zubastic/PrintDialogBug

@rladuca could u help me with that issue? 1607 is important for me, because enterprise use LTSB version. At 1809 and newer version all is good.

Metadata

Metadata

Assignees

Labels

BugProduct bug (most likely)urgentstatus: This issue needs immediate attention

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions