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 ?
I had the same issue after upgrading a ASP.NET Core 2.2 project to ASP.NET Core 3.0. I have used a trick to find out the process I should attach to whenever needed:
In my case the process was called {AssemblyName}.exe.
Side note: You can find Reattach extension particularly useful for quickly reattaching (e.g. Ctrl-R Ctrl-1) to previous processes.
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:

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With