Issue
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
.
Solution
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.
Answered By - CodingNagger
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.