1

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?

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
Selthien
  • 1,178
  • 9
  • 33

1 Answers1

0

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.

  • I don't believe that is the case because the program is starting just fine. I just can't see the application window. I know for a fact I can start the .exe from IIS as I am then able to run subsequent commands against the opened application. For some reason the UI just does not pop up. – Selthien Jul 15 '20 at 19:57
  • Yes, the application will run, but it will run under the service realm and not be visible in the user's desktop. – CravingMender9 Jul 15 '20 at 20:03