-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.NET core WPF print dialog freeze/not supported exception #2609
Comments
Oh well ! |
Any dotnet core version fixed this bug ? @dmarcello53 . Please |
@hnhai windows 1903 and newer is fixed. |
bump, @danmosemsft could you help with this issue? |
@danmosemsft it depends on windows version. At 1607 its broken (LTSB for enterprise users), at 1809 or newer - it is OK. But enterprise couldn't update :( |
cc @fabiant3 also |
The problem is likely to be that the serialization manager for the legacy path, This isn't a workaround, but a potential test. If you force the value there to be true (perhaps forcing the static underlying the function call here) do things work? Note there may be other instances where another piece of code needs to pivot on this sort of check for printing support, but I don't have a full understanding of all of those places (@miguep maybe?). @ryalanms One thing you might want to check is if you can just remove the OS check or extend support for it downward. The minimum client is low, but this was guarded so as to not explicitly change behavior on applications targeting lower versions. For .NET Core it might make sense to remove this and move forward. It would need good testing, but might help alleviate the pain of fixing up the legacy serialization classes. Of course, that could just be the outside layer of issues, I haven't tried. |
This appears related to a57ed01 In this case, based on the callstack, it seems that wpf/src/Microsoft.DotNet.Wpf/src/System.Printing/CPP/src/PremiumPrintStream.cpp Lines 442 to 467 in 5841f8b
But then is directly calling down to the SpoolStream:
And the SpoolStream is created with CanRead as false Line 180 in 5841f8b
and hardcodes CanSeek to false: wpf/src/Microsoft.DotNet.Wpf/src/System.Printing/CPP/src/XpsPrintJobStream.cpp Lines 83 to 90 in bfe7907
Perhaps the fix here is to simply update PrintStream to delegate the Can* properties to the SpoolStream like it is doing for the actual Read|Write|Seek methods. That will let the calling code "know" that the backing stream cannot read or seek and write the Package/ZipArchive in a way that doesn't do any seeking. |
This was fixed in .NET 5.0 in our internal repo (in PresentationNative), but was not backported to 3.1. /cc @dotnet/wpf-developers |
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:
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.
The text was updated successfully, but these errors were encountered: