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."
If a source file has changed and the source no longer matches the code you're debugging, the debugger won't set breakpoints in the code by default. Normally, this problem happens when a source file is changed, but the source code wasn't rebuilt. To fix this issue, rebuild the project.
Open the Debug view by selecting the Debugging icon on the left side menu. Select the green arrow at the top of the pane, next to . NET Core Launch (console). Other ways to start the program in debugging mode are by pressing F5 or choosing Run > Start Debugging from the menu.
Restart your Application Pool. Check that your Web Application folder has the right permissions. Make sure that you give IIS_IUSRS, IUSR, or the specific user associated with the Application Pool read and execute rights for the Web Application folder. Fix the issue and restart your Application Pool.
In Visual Studio, from the Tools menu, choose Launch Under Debugger. In the Launch Under Debugger dialog box, enter the path to the executable file. You can also enter arguments and a working directory. Click Launch.
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
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