Windows 8上的Adobe Reader无法使用Process.Start(/ * pdf路径* /) [英] Process.Start(/* path to pdf */) doesn't work with Adobe Reader on Windows 8

查看:173
本文介绍了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.

这篇关于Windows 8上的Adobe Reader无法使用Process.Start(/ * pdf路径* /)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆