简体   繁体   中英

Process.Start() working but no window is popping up

I have a web API project that has a call that allows the user to basically start a separate application on the server.

Basically my web API is a gateway to remotely call this application from an MVC project.

Problem:

The problem I am facing is that the Process.Start() method is working perfectly (as in I can see the process starting on the server's task manager) but no window is popping up? I can run the application directly and see it start in its own window.

Web API Code:

public void ReconnectEPLAN()
{
    if (CheckEplanConnection() == false)
    {
        Process process = new Process();
        process.StartInfo.UseShellExecute = false;
        process.StartInfo.FileName = @"C:\Program Files\EPLAN\Pro Panel\2.8.3\Bin\W3u.exe"; //works but no ui poopup
        process.StartInfo.CreateNoWindow = false;
        process.Start();
    }
}

What can I do to force the started process's app window to appear as well?

On your server, IIS runs as a service (unlike IIS Express, which runs in the user space). Since Windows Vista, services can no longer interact with the user's desktop directly.

See:

Services cannot interact directly with the user at all: this is because services can run on a machine that doesn't have a user logged in at all, so there is no way to interact with them.

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