I have an application that I'm working on and I allow the user to select a printer to use as their printer while printing forms from the application. I'm using .NET 2.0
In the settings screen, I call
System.Drawing.Printing.PrinterSettings.InstalledPrinters
to get the list of available printers.
On a client's machine, the property throws an exception:
System.ComponentModel.Win32Exception: The RPC server is unavailable
The client is reporting that windows shows his printer as 'ready', and the client can print test pages from the printer. But, I have not been able to reproduce this issue locally and I'm running out of ideas. Does anyone have any ideas what could cause this issue? Any ideas or directions to look would be helpful. Thanks
This same thing is happening to me in Windows 7. Stopping and starting the print spooler in services fixes until it happens again.
The following commands make it quick to do this:
net stop "print spooler"
net start "print spooler"
Note: Run the command prompt as Admin. I made a batch file to do this because it happens 4-5 times a day during development.
If you can print, most likely a security issue. Otherwise I would have voted "dead spooler service" but more likely your app doesn't have the rights to communicate with the spooler service...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With