I am currently trying to setup some UI tests on a Core web app, however I am not able to get the web app started. Using the command line directly with "dotnet run" from the web app directory works. The problem comes when I try to use Process to run it before executing my tests nothing happens.
var process = new Process
{
StartInfo =
{
FileName = "dotnet",
Arguments = "run",
WorkingDirectory = applicationPath
}
};
process.Start();
Has anyone been confronted to a similar issue before and/or managed to solve it? I may be misusing Process
.
Turns that adding
UseShellExecute
to my StartInfo and setting it tofalse
made it work:The default for
UseShellExecute
is true but it would be similar to runningcmd dotnet run
instead ofdotnet run
which is what I needed.Try this