The way we are used to debug a running "IISExpress" process in .Net Framework is by attaching a process by the name "iisexpress.exe" in Visual Studio. But attaching the iisexpress process is not working in .Net core. It shows the message - "The breakpoint will not currently be hit. No symbols have been loaded for this document."
-
related: https://stackoverflow.com/questions/50806765/to-which-process-should-i-attach-visual-studio-debugger-to-debug-a-kestrel-appli – Ruben Bartelink Dec 05 '18 at 14:31
4 Answers
To debug a running iisexpress instance in .Net core, you will have to attach "dotnet.exe" process in Visual Studio.
*Update - 1: If dotnet.exe does not work for you, check "{projectName}.exe" as well.
*Update -2: Attaching "iisexpress.exe" works with .net 5
![](../../users/profiles/1640234.webp)
- 1,451
- 2
- 12
- 25
-
Thanks for sharing your solution here, you could mark it as the answer later. Have a nice day. – Fletcher Mar 16 '18 at 05:42
-
-
I think this is not working for .Net Core 3.0+ projects. Attaching to "dotnet.exe" process(es) gives me a warning message on the breakpoint. Attaching to the
.exe does the job. – mihkov Jan 19 '21 at 17:56
In Visual Studio 2019 using "dotnet watch run" I could no longer attach to the "dotnet.exe" process, I would get the Symbols could not be loaded error, took me a while to figure out but instead I attached to [project name].exe which is in the list of running processes and I could successfully attach the debugger to a process with symbols loaded and debug.
![](../../users/profiles/10377255.webp)
- 151
- 1
- 5
In my case, using Asp.Net Core 2.2 with InProcess
Hosting Model, the accepted answer doesn't work. But, I should choose from the menu Debug
> Attach to process
, then select the "Show processes from all users" checkbox (below the list of process) and select "iisexpress.exe". It works properly and hit the break points.
![](../../users/profiles/2803565.webp)
- 6,368
- 2
- 29
- 53
Visual studio does not loads all dlls (don't know why). Try this:
1) First attach with w3wp.exe (for InProcess Hosting) or dotnet.exe (for OutOfProcess Hosting)
2) Load Symbols manually:
Go to Debug > Windows > Modules (or try shortcut Ctrl + Alt + U)
Search and select dll (and dependent dll's) which you want to debug and right click > Load Symbols.
![](../../users/profiles/5558677.webp)
- 922
- 1
- 12
- 21