Why does dotnet run launch 2 processes?

时间:2018-02-03 08:24:12

标签: .net-core dotnet-cli

When I run my dotnet core 2 app from my PowerShell I always see 2 processes launched. This is annoying as in Visual Studio 2017 I cannot "reattach" a debugger as there are always 2 processes with the same name "dotnet".

enter image description here

Any way to change this?

1 个答案:

答案 0 :(得分:2)

dotnet run是一个开发命令,用于构建项目并查询项目以查找要运行的实际命令。然后启动程序中描述的程序 - 可能是dotnet some.dllsomeapp.exe,具体取决于程序类型。

要解决您的问题,请运行

之类的命令
dotnet bin\Debug\netcoreapp2.0\mapp.dll

直接避免过程噪音。

您也可以在它之前链接一个构建命令,这样您就可以在更改时重建项目,并且仍然有运行msbuild的进程终止:

dotnet build; dotnet bin\Debug\netcoreapp2.0\mapp.dll