IIS7不会通过Process Start启动我的Exe文件,但它在任务栏中运行 [英] IIS7 does not start my Exe file by Process Start but it's running in task bar

查看:555
本文介绍了IIS7不会通过Process Start启动我的Exe文件,但它在任务栏中运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个带有进程启动的项目,它在c#中运行在本地visual studio构建中,当我在IIS中托管时它没有运行但是它正在启动进程而没有显示任何内容我在任务管理器中检查过它。代码示例:

I have created a project with process start in c# it's running in local visual studio build,when I hosting it in IIS it's not running but it's starting the processes and nothing is displaying I checked it in task manager.Code sample:

  Process process = new Process();
  process.StartInfo.FileName = "calc.exe";
  process.StartInfo.UseShellExecute = false;
  process.Start()process.WaitForExit();

我试过以下解决方案

IIS7无法通过Process Start启动我的Exe文件

Foo.cmd不会输出正在处理的行

System.Diagnostics.Process.Start无法在IIS中运行

没有如果有人知道请帮助我

nothing helped.If any one knows please help me

推荐答案

我搜索了很多,最后找到了解决方案,我很乐于助人某些人。

I have searched a lot and finally I find a solution,It my be helpful to some one.

解决方案:

带有IIS的Asp.net运行服务应用程序,这意味着它在另一个Window Station和Desktop下运行。但是,在Windows中,默认的可见Window Station和Desktop是WinSta0 \Default,它是Shell(explorer.exe)运行的位置。所以你创建的.exe显示在一个不可见的桌面上。

Asp.net with IIS runs as a service application, which means that it runs under another Window Station and Desktop. However, in Windows, the default visible Window Station and Desktop is WinSta0\Default, which is where the Shell(explorer.exe) runs. So the .exe you created is displayed in an invisible desktop.

实际上,Window Station和Desktop是一个很好的GUI安全沙箱,因为Windows不需要普通的GUI应用程序通过Windows消息通信其他服务应用程序。

Actually, Window Station and Desktop is a good sandbox for GUI security, since Windows do not want the normal GUI application to communication other Services applications through Windows Message.

要从不可见的服务应用程序显示GUI,您必须打破WinSta0 \Default的安全沙箱,这有点复杂。

To display the GUI from a non-visible service application, you have to break the security sandbox of WinSta0\Default, which is a little complex.

但是,如果你想创建一个可见的过程,那真的很难。通常,推荐的解决方案是创建第二个GUI应用程序,如Winform,Asp.net和Winform可以通过.Net Remoting或其他Inter进程通信技术进行通信。当Asp.net想要创建可见的记事本进程时,它可以通过Net Remoting告诉Winform客户端,然后Winform只代表Asp.net进程处理Proces.Start notepad.exe。

However, if you want to create a visible process, it is really hard. Normally, the recommended solution is creating a second GUI application like Winform, and the Asp.net and Winform can communicates through .Net Remoting or other Inter process communication technologies. When the Asp.net wanted to create the visible notepad process, it can tell the Winform client through Net Remoting, then Winform will simply Proces.Start notepad.exe on behalf of Asp.net process.

.Net Remoting是解决此问题的解决方案
(请参阅此链接 .NET Remoting,带有一个简单的例子

点击此处

这篇关于IIS7不会通过Process Start启动我的Exe文件,但它在任务栏中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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