Windows 8上的Adobe Reader无法使用Process.Start(/ * pdf路径* /)

问题描述:

我能够在C#/ WPF应用程序中创建PDF并使用以下命令运行它们:

I'm able to create PDFs in my C#/WPF application and run them with the following:

Process.Start(_pathToPDFFile);

此功能适用于Adobe Acrobat,但不适用于Adobe Reader。安装Adobe Reader后,除非任务管理器中已经运行了Reader进程,否则 Process.Start()不会执行任何操作。

This works with Adobe Acrobat, but not with Adobe Reader. When Adobe Reader is installed, Process.Start() does nothing unless the Reader process is already running in the Task Manager.

尝试启动PDF时如何让Adobe Reader显示PDF?

How can I get Adobe Reader to show the PDF when I attempt to start a PDF?

在我们的例子中,仅当从Visual Studio启动应用程序时,该问题才可重现-启动.exe可直接按预期工作。

In our case, the problem was only reproducible when starting the application from Visual Studio - starting the .exe directly works as expected.

之后进行一些调试后,结果发现Visual Studio被设置为始终以管理员身份运行,从而导致了问题。关闭此功能(本身就很难做到)解决了该问题。

After some debugging, it turned out that Visual Studio was set to always run as administrator, which causes the issue. Turning this off (which is hard enough itself) fixes the problem.

不过,仍然不确定为什么会发生这种情况。

Still not sure why this happens, though.