-
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
PrintServer.GetPrintQueues throws NullReferenceException #8339
Comments
@wstaelens https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/System.Printing/ref/System.Printing.cs#L393 is the reference project. In other words, it do not run in the user's devices. So I do not think it will cause any issues. It will be helpful, if you can append the exception stacktrace. |
well the strange thing is that we sometimes get a nullreference. If feels like it happens when something is taking too much time or is initializing. Because 99% of the time I get the queues but sometimes i get that null result. (don't know if it might be related to VS and its debugging context or not) |
stacktrace:
|
@wstaelens It seems that you are using a disposed PrintSystemObjectFactory object. |
Just calling GetPrintQueues so don't see why it is disposed or why i'm using disposed one. I've noticed that sometimes after adding a new printer, the Windows Control panel freezes and after 30seconds or a few minutes it loads fine. Must be something in Windows which has been changed and maybe relates to this. Anyone else experiencing thing? |
Description
when calling GetPrintQueues I sometimes get a NullReferenceException (not always)
Reproduction Steps
Expected behavior
never having a nullreference exception
Actual behavior
sometimes (don't know how to reproduce it) I get a NullReferenceException. (feels like it happens the first time something needs to be initialised.)
Regression?
No response
Known Workarounds
No response
Impact
No response
Configuration
.net 7 latest
windows 10 x64 22h2
vs2022 pro any cpu
Other information
when looking at https://github.com/dotnet/wpf/blob/main/src/Microsoft.DotNet.Wpf/src/System.Printing/ref/System.Printing.cs#L393 I see that it throws null, but I have print queues as a result, sometimes it throws null, but don't know why exactly.
The text was updated successfully, but these errors were encountered: