I have two Asp.Net Core projects - one is version 2.2. and one is version 3.0.
Each project is a brand new, empty MVC project created in Visual Studio.
I run each project by dropping to the command line and doing dotnet run
.
I then debug my code as follows:
dotnet
processDebug -> Attach to Process
in Visual Studio 2019For the version 2.2 project, I can easily identify the correct dotnet
process in Task Manager - it's the one showing the dotnet exec
command pointing to my project's .dll
file:
However - for the 3.0 project, the dotnet
processes in Task Manager look like this:
None of the processes is clearly associated with my project's .dll
files, and none of them allows me to debug my code using Attach to Process.
So my question is - is there a way of attaching Visual Studio's debugger to an Asp.Net Core 3.0 project when I run it using dotnet run
?
Turns out that the Asp.Net Core 3.0 project, when run using dotnet run
, has a different entry in Task Manager than 2.2 - the .exe
file produced by the build is what is displayed in Task Manager's details, and I can successfully attach to this process in Visual Studio: