Hi,
I am trying to start a process from inside a .NET service. The process is a
simple GUI app, the service will start up the GUI and then stop itself. The
service starts the app, but no GUI appears. However, I can see the
application running in the task manager. I made sure that CreateNoWindow was
set to false and still no GUI appears. If i run the application by double
clicking on it, the GUI appears fine. Here is the code:
Process p = new Process();
p.StartInfo.FileName = _basedir + "DbUpdate.exe";
p.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
p.StartInfo.CreateNoWindow = false;
p.StartInfo.UseShellExecute = true;
p.Start();
Essentially, I am checking the version of a database and if it is not the
correct version, I want to stop the service and start up the updating
utility. The service runs, starts the process, and exits as expected, but
the GUI does not appear, except as a process in Task Manager. If it matters,
I am executing the code through a class using remoting and it is in the
constructor of the class. Also note that the service exits immediately after
starting the process, although I did not think that would be a problem.
If anyone has any insight into the cause of this problem, it would be very
helpful to me.
-Timothy Shih