简体   繁体   中英

call exe from wcf service

We have a WCF service that we recently switched from self-hosting to IIS-hosted . It needs to launch an executable using Process.Start() . This works fine when it's self-hosted, but when hosted in IIS , we get the error:

TimeOutException was unhandled

void notepad()
{
    System.Diagnostics.Process.Start("notepad").waitForExit();
}

Any help would be appreciated. Thanks!

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 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. So you can start processes that have no UI.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM