1

I need to start an .exe via my web application, it works on my local machine But it does not work on server.

I am using windows server 2008 R2 Enterprise and here is my code

ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = @"C:\hkLog\FirmwareUpdaterGUI.exe";
startInfo.WindowStyle = ProcessWindowStyle.Minimized;
startInfo.Arguments = list;
Process.Start(startInfo);

Thanks in advance,

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
thehilmisu
  • 342
  • 1
  • 5
  • 13

2 Answers2

0

This is probably due to the following

  1. By default, ASP.NET runs its worker process (Aspnet_wp.exe) which doesn't have permission to interact with desktop.

  2. By default, IIS Admin Service won't allow its application to interact with desktop.

You will need to change asp.net worker access to enable it to access the desktop as well as change IIS settings. Microsoft support

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
0

This is probably a permissions issue (based o the identity your app domain is running under). I recommend the following.

What you should see if your worker process attempting to access the executable path to launch it and failing. The failure will be detailed in the entry in process monitor. You can then determine what permissions you're missing.

Alternatively, you could move the executable to a path where you know the worker process identity has full permissions to test.

kdtong
  • 184
  • 2
  • 14
  • Hello i have downloaded and monitor the process and see that the process starts but ends as soon as it starts. The .exe file contains a timer that runs a statemachine but it never executes. It starts and ends after. – thehilmisu Jan 05 '15 at 14:53
  • 2
    If it works fine in your development environment but not on the server than I recommend using a remote debugger (http://msdn.microsoft.com/en-us/library/y7f5zaaa.aspx) to debug the process to see why it's not executing to your expectations. If you can reproduce the same issue locally, I'd debug locally first. – kdtong Jan 05 '15 at 15:53