Programmatically start a .NET Core web app for Selenium testing
Turns that adding UseShellExecute
to my StartInfo and setting it to false
made it work:
var process = new Process{ StartInfo = { FileName = "dotnet", Arguments = "run", UseShellExecute = false, WorkingDirectory = applicationPath }};process.Start();
The default for UseShellExecute
is true but it would be similar to running cmd dotnet run
instead of dotnet run
which is what I needed.
Try this
ProcessStartInfo Startinfo = new ProcessStartInfo(); Startinfo.FileName = "D:\\TFS\\QA\\SH_LoadTest\\SH_LoadTest\\bin\\Debug\\SH_LoadTest.exe"; StartInfo.Arguments="Your Arguements"; Process pro = Process.Start(Startinfo);