是什么原因导致System.Drawing.Printing.PrinterSettings.InstalledPrinters抛出Win32Exception" RPC服务器不可用&QUO

2023-09-06 14:50:49 作者:Story!剧终°

我有我的工作的应用程序,我允许用户选择打印机作为自己的打印机打印时从申请表格中使用。我使用.NET 2.0

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

在设置画面,我称之为

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

推荐答案

如果可以打印,最有可能的安全问题。否则,我会投死后台服务,但更可能你的应用程序没有与后台服务进行通信的权利......

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...