I have two C# projects, one is trying to run the other as a process. The master project starts the process of the other like this:
ProcessStartInfo info = new ProcessStartInfo(filepath, args);
info.Verb = "runas";
info.UseShellExecute = true;
if (file.Exists(filepath))
{
_fileID = Process.Start(info).Id;
}
else
{
throw new Exception("Could not find file.exe at " + filepath);
}
The project that is being started as a process builds into a console application and only contains one .cs file which only has a Main()
.
The process should immediately run this Main method, however I set a breakpoint on the first line of the main method and it never gets hit. The executable has been attached to the process created from the master project, and the file path is correct.
My question is if I am debugging this process correctly, and if there is a better way to debug a project file inside of a process?