Click here to Skip to main content
15,940,246 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I want to run the .exe from web application. On Button Click I have written the C# code to start the Process.

This code is working from my local system when I am running the application from Visual Studio. Exe is executing and showing the desired output.

But after deployment to the server when clicking on the button to run the exe, nothing is happening.

In task Manager on server, I can see the exe in the process section but 0% CPU usage but not working and showing the expected output.

I am missing anything? Please advise

What I have tried:

string exeFileName = _Configuration["AppSettings:DANearDuplicatesEXEPath"];

LogMessages("FileName - " + exeFileName);

ProcessStartInfo processInfo = new ProcessStartInfo();
processInfo.WorkingDirectory = Path.GetDirectoryName(exeFileName);
processInfo.FileName = exeFileName;
processInfo.ErrorDialog = true;
processInfo.UseShellExecute = false;
processInfo.Arguments = "/l\"" + baseDir + "inputlist.csv\" /i\"" + baseDir + "Coding\" /t4 /m\"" + baseDir + "MassNearDup.txt\" /q";
processInfo.RedirectStandardOutput = true;
processInfo.RedirectStandardError = true;
Process proc = Process.Start(processInfo);

proc.WaitForExit();
/pre>
Posted
Updated 29-May-22 3:57am
v2

1 solution

We can't help you fix this: we have no access to your server or the app.

But ... it's likely a permissions problem. Websites in production run under a special user account, so it may not have the right permissions to access the folder the exe is in, or perhaps even to run any application (depending on your server settings), or the app might be trying to tell you something and is stuck waiting for a response to a message box which no-one can see. We can't tell.

Start by contacting the admins or tech support for your server and explain what you are trying to do. They may be able to help you - but we can't.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900