Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I am trying to figure out a way to call a .exe application written in C#, from within an ASP.NET/c# Web Application. I have the following:

C#
Process p = new Process();
p.StartInfo = new ProcessStartInfo(@"C:\<filePath>\<filename>.exe", "00000170");
p.StartInfo.UseShellExecute = true;
p.StartInfo.RedirectStandardOutput = false;
p.Start();


The call to the .exe file works fine. My issue is within the .exe application, any exceptions thrown should be written to a text file. Which isn't occurring when the application is called this way. The .exe works as expected when it is called outside the Web application.

Can anyone help with the exception output please?

Also, it would be great is the Web application could call the .exe application, let it run in the background but then continue on with it's own processing without waiting for the .exe to finish executing. The Web application is not reliant on the results from the .exe.

Thank you
Posted
Comments
ZurdoDev 19-Sep-14 12:02pm    
It's a permissions issue then. The windows exe is running as the identity in the app pool.

1 solution

"The call to the .exe file works fine."

I really, really wouldn't be too sure about that if I was you...

I'd check it in a production environment before you go any further. Why? Because the C# code is executed on the Server, not the Client, and what seems to work fine in development where they are the same computer doesn't do anything useful in production...
 
Share this answer
 
Comments
MWRivera 23-Sep-14 11:24am    
Thank you for the feedback OriginalGriff. I guess what I should say is that I can see that the .exe application is being called in the development environment, which is al I have available to me right now.

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