Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Breakpoints not hit when debug website project after update to VS 2015 Update 3

I have a web project (DNN module) that I am developing and I recently updated to Visual Studio Professional 2015 Update 3.

I am using IIS 10 on a windows 10 PC

When I try to F5 / Debug my app I get the following warning on any breakpoints:

the breakpoint will not currently be hit. no symbols have been loaded for this document

What I have tried to fix this:

  • I enabled directory browsing inside IIS 10
  • I Run VS in admin mode / elevated permission
  • Updated MS ASP.NET and Web Tools extension to latest version
  • Updated MS ASP.NET Web Framework and tool extension to latest version
  • cleared out and re-downloaded all debug symbols
  • Clean and rebuilt in both release and debug mode
  • Made sure modules runAllManagedModulesForAllRequests="true" is set in system.webserver of web.config
  • Restart IIS / refresh application pools, and restart website
  • using a different port for the website
  • obviously restart computer / and visual studio

I am at a total loss and really need help. I can not figure out why my breakpoints are not being hit, when I debug the site no errors are thrown and the site runs fine.

Other Attempts:

From this SO thread I tried:

  • Install Update for Microsoft Visual Studio 2015 Update 3 (KB3165756)

From This SO Thread I tried:

  • disable "just my code" in debug general settings

From User suggestions:

  • I have tried attaching directly to the w3wp.exe process - no breakpoints hit and visual studio crashes when I try to stop debugging. Also, as soon as I attach the debugger, the website stop workings all together

Question

Can someone help me figure out why my break points are not being hit when debugging from visual studio.


EDIT # 1: Additional attempts

  1. When I debug my application and open the Debug -> Windows -> Modules window I do not see the name of my projects dll / pdb file in the list of Modules. I tried going to Debug -> Options -> Symbols and clicking the Load All Symbols button. I included a screen shot. My dll or project is named krisisShifts so the dll created in the obj/Debug folder is krisisShifts.dll and KrisisShifts.pdb etc. The blue mark on the image shows the dll is not listed in the loaded modules. Also I included the default attached process Visual studio is using to debug the site marked in Red.

enter image description here

  1. I also deleted the site and application pool from IIS and recreated them with different names, site displays fine, but no breakpoints hit

EDIT 2: Attach to process now works

Not sure what I did. I have been fighting with this all day and afer restarting the computer and visual studio numerous times I can now attach to process w3wp.exe and the breakpoints are hit.

However hitting F5 still does not work. The site loads but no breakpoints are hit and I can see that my projects .dll is not added to the debug modules list (but it is when I attach to process).

I feel like I am closer but still can not figure out why my project .dll is not loaded in the debug modules when hitting f5.

like image 597
J King Avatar asked Sep 30 '16 05:09

J King


People also ask

Why won't the Visual Studio debugger stop on breakpoints?

When you debug ASP.NET applications in Visual Studio .NET, the debugger might not stop on breakpoints. This problem occurs because ASP.NET debugging isn't enabled on the application. To resolve this problem, follow these steps in Visual Studio .NET: Right-click your project from the Solution Explorer, and then click Properties.

What is breakpoint warning in Visual Studio?

Breakpoint Warnings. When debugging, a breakpoint has two possible visual states: a solid red circle and a hollow (white filled) circle. If the debugger is able to successfully set a breakpoint in the target process, it will stay a solid red circle.

How do I change the default breakpoints for debug mode?

To modify this setting for all breakpoints, go to Debug > Options and Settings. On the Debugging/General page, clear the Require source files that exactly match the original version option. Make sure to reenable this option when you're finished debugging.

Why is the breakpoint that I set not hit?

You set a breakpoint in the project. You start debugging the project. In this scenario, the breakpoint that you set is not hit. Note This problem does not occur when you use the release version of Microsoft Visual Studio 2010. This problem occurs because Visual Studio treats the add-in as a .NET Framework 2.0-based application.


1 Answers

Are you able to attach directly to the w3wp.exe process, and if so are your breakpoints hit then?

  1. Menu > Debug > "Attach to process..."
  2. Check "Show processes from all users"
  3. Look for a process named "w3wp.exe", with the username "IIS APPPOOL\{IIS site name}"
  4. Click "Attach"
like image 61
NJH Avatar answered Sep 19 '22 12:09

NJH