First off i have checked the web to try and find an answer however i have only come across people who want to run their processes in the background whereas my issue here is the opposite way round.
I have entered the following code on my controller whereby the process is initiated when the button is clicked:
string fileLocation = @"C:\somefolder\anotherFolder\...\application.exe";
ProcessStartInfo oStartInfo = new ProcessStartInfo();
oStartInfo.FileName = fileLocation;
oStartInfo.UseShellExecute = false;
oStartInfo.CreateNoWindow = true;
oStartInfo.WindowStyle = ProcessWindowStyle.Normal;
oStartInfo.CreateNoWindow = false;
var process = new Process { StartInfo = oStartInfo, EnableRaisingEvents = true };
process.Start();
now I have run the code and it is executing the exe or so it would appear when i open up the task manager. But i cant seem to get this to execute in the foreground so the user can do what they need to do.
*Extra Information
Whenever i try to rebuild after running there is an issue because the exe is in the same solution as the web part of the project, but the issue is the fact i have to go to task manager and kill the process as otherwise it cant access the .exe -- this is another major reason i need to run it in the foreground
Visual Studio 2013 Express for web
- Entity Framework
- MVC Asp.Net web project
Any help would be really great!