wcf iis host 打开exe失败 不能显示界面

最近谷歌没法用了,我的freegate经常性的崩溃

无奈之下,用了必应,貌似也不错

http://*.com/questions/8414514/iis7-does-not-start-my-exe-file-by-process-start

第一种方法

Edit:

After a long journey, me and Nasenbaer have found the following. The possible reasons for IIS to fail run an EXE are:

  1. Lack of permissions for IIS Users, such as the application pool user, or the Network service (in IIS6).
  2. x86 EXE running on x64 machine issues.
  3. Typical EXE failure issues such as missing dependencies.

Original answer:

You need to assign FullControl security permissions for the IIS AppPool\DefaultAppPool user, on the directory the EXE is located in. This is the user that is trying to run the process (assuming you are using the DefaultAppPool), and without the proper permissions, it is unable to do so.

When you run the EXE manually, you are using the Windows logged in user. This is why you are able to lunch it manualy. The IIS uses the Application Pool user.

To add permissions just do the following:

  1. Go to directory properties
  2. Security tab
  3. Edit.. -> Add the IIS AppPool\DefaultAppPool
  4. Check for it the FullControl

首先,提供了一般情况下无法打开exe的原因

如果其他方式可以打开,只有在wcf iis host中无法打开,那么就是权限的问题

一般情况下,我们打开exe使用的是windows登录的账户,但是iis是通过应用程序池去打开的

默认情况下,应用程序池是没有打开exe的权限的,所以需要给指定的exe添加应用池权限,

需要注入添加账户的时候必须输入完整的 IIS AppPool\DefaultAppPool,才能正常添加

打开的进程在后台中显示,打开的用户是DefaultAppPool

wcf iis host 打开exe失败 不能显示界面

第二种方法

What helped me is this: Setting in Application Pool Identity = LocalSystem

  1. Open Application Pools
  2. Find your pool (by default DefaultAppPool)
  3. Click on "Advanced settings"
  4. Change Identity to "LocalSystem"

Hopefully it will help somebody...

能够打开exe进程的,但是不会显示界面

http://*.com/questions/7209505/how-to-start-a-process-from-an-iis-hosted-wcf-service

Oleksii, the point is that if you host the WCF service in a console application, there is a windows session (a user logged in and Windows Explorer loaded) for that user and the notepad is opened and shown for that user, so you see it in the UI.

when you host your WCF service in IIS, being a server, IIS requires and allows no user interaction and works also if no user is logged in; in that context there is no UI to host your notepad or other UI enabled applications, you could execute a process for elaboration or other batch jobs but not render a windows UI application, because Windows Explorer is not loaded for you and there is no place to render your process's UI.

http://codeblow.com/questions/steps-to-start-a-procedure-from-an/

上一篇:tomcat(三)--基本安装配置


下一篇:《android开发艺术探索》读书笔记(三)--分发机制和滑动冲突