PeterFromCologne
PeterFromCologne

Reputation: 10453

Why does dotnet run launch 2 processes?

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?

Upvotes: 3

Views: 1091

Answers (1)

Martin Ullrich
Martin Ullrich

Reputation: 100581

dotnet run is a development command that builds the project and queries the project for the actual command to run. It then launches the program described in the program - which may be a dotnet some.dll or someapp.exe depending on the program type.

To work around your issue, run a command like

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

directly to avoid process noise.

You can also chain a build command before it so you can rebuild the project on changes and still have the process that runs msbuild terminate:

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

Upvotes: 4

Related Questions