Original: C # ASP. NET WebService calling external EXE invalid workaround
Recently with ASP. WebService, one of the functions is to invoke the execution of external EXE (similar to the execution of CMD), but after the execution of Process.Start there is no result, the same code in WinForm Normal, toss two days finally found a solution
This article refers to the following pages, thank you very much
http://bbs.csdn.net/topics/300053869
Http://blog.163.com/[email protected]/blog/static/15737970200862331842368/
Environment: Win7 SP1 64-bit and iis,vs2010 compiled as x86 program
First to service IIS Admin Service (double-click on him) sign in to "Allow service to desktop interaction"
Then set up a Web program, set up as a "website", and build the site automatically after the corresponding application pool
Select the corresponding application pool, click Advanced Settings, modify the process model in which the "identity" is LocalSystem
Then restart the Iis,iis Admin service and so on, OK.
PS: Some of the internet has said that the IIS Admin Service is possible, there may be some situations can be, we pay attention to
PS2: "Identity" of the application pool, if LocalSystem not, then set up "Custom account", account with Administrator account (administrator)
PS3: This effect may be a little different from what the WinForm desktop program does, such as the EXE program I called, which has a command-line form that appears after the WinForm call, and the WebService call does not have a command-line form, but through the task Manager You can see that the process is running