从调用Web应用程序的C#(.exe)的控制台应用程序时,命令提示符下不打开 [英] command prompt do not opens up when calling (.exe) console application from web application c#

查看:193
本文介绍了从调用Web应用程序的C#(.exe)的控制台应用程序时,命令提示符下不打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用从我的web应用程序这个函数来调用exe文件。当它调用.exe文件的每一件事情发生的准确,我可以看到它在任务管理器的进程正在运行的进程,但为什么不命令提示符打开时,这个过程被称为

i am using this function from my web application to call exe file . when it calls .exe file every thing happens accurately, i can see it as running process in task manager processes, but why dont the command prompt opens up when this process is called.

Web应用程序托管在同一系统的IIS。

the web application is hosted on iis of same system.

 public void RunconsoleApplication(string Id)
    {
        // Get the file path of your Application (exe)
        string filePath = @"E:/ConsoleApplication1/ConsoleApplication1/bin/Debug/ConsoleApplication1.exe";

        System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo(filePath, Id);

        System.Diagnostics.Process p = System.Diagnostics.Process.Start(info);//called       

    }

更新

运行视觉atudio相同的应用程序时,命令提示符打开。但不要在IIS托管时

when run the same application on visual atudio, the command prompt is opened. but it dont when hosted on iis

推荐答案

IIS及其子进程在不同(无窗)会话中运行。所以你不能看到,如果窗口已打开。还有些过程可能表现strangly由于这个(你可能没有打这样的问题,unlikly到与控制台应用程序问题)。

IIS and its child processes are running in different (and windowless) session. So you can't see if window is open. Also some processes may behave strangly due this (you probably did not hit such issues, and unlikly to have problems with console apps).

您可以通过打开看看吧在任务管理器会话ID列:查看 - >选择columns->会话ID(在进程选项卡)

You can see it by turning on "Session ID" column in task manager: View -> Select columns-> Session ID (on processes tab).

这篇关于从调用Web应用程序的C#(.exe)的控制台应用程序时,命令提示符下不打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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