Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Breakpoint in ASP.NET MVC Razor view will not be hit. No symbols have been loaded for this document

I can't get a breakpoint in a Razor view to be hit in Visual Studio 2013 while debugging in IIS Express.

This is the view and unreachable breakpoint:

enter image description here

Looking at the modules I see that the latest PDB file has been loaded:

enter image description here

And the folder

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\53ff8402\967c7053\assembly\dl3\f3c59a34\6698ffde_b452cf01

has the latest version of the DLL and PDF files:

ITVizion.VizionLogs.WeeklyLogs.Web.DLL
ITVizion.VizionLogs.WeeklyLogs.Web.PDB

I have already cleaned the solution, wiped the project's bin folder, restarted Visual Studio, etc but it still won't hit the breakpoint.

What else can I try?

like image 531
Leniel Maccaferri Avatar asked Apr 07 '14 23:04

Leniel Maccaferri


People also ask

How do I fix No symbols have been loaded for this document?

"No Symbols have been loaded for this document"Go to the Modules window (Debug > Windows > Modules) and check whether your module is loaded. If your module is loaded, check the Symbol Status column to see whether symbols have been loaded. If symbols aren't loaded, check the symbol status to diagnose the issue.

How do you fix the breakpoint will not currently be hit no symbols loaded?

Ensure debug configuration, debug flag, and full debug information are set on all assemblies. Delete all bin and obj folders and all DLL files related to the project from my entire machine. Recreate projects causing the problem from scratch. Reboot.

How do I hit a breakpoint in Visual Studio?

To set a breakpoint in source code: Click in the far left margin next to a line of code. You can also select the line and press F9, select Debug > Toggle Breakpoint, or right-click and select Breakpoint > Insert breakpoint. The breakpoint appears as a red dot in the left margin.


1 Answers

Can't believe it guys... wasted almost 1 hour on this. I was trying to debug the wrong view in the wrong path.

I set a breakpoint in this view:

C:\ITVizion\VizionLogs\ITVizion.VizionLogs.WeeklyLogs.Web\Views\Error\ServerError.cshtml

but actually I was trying to debug this view:

C:\ITVizion\VizionLogs\ITVizion.VizionLogs.WeeklyLogs.Web\Views\Shared\Error.cshtml

After I placed a breakpoint in the correct view, although it showed the message about the breakpoint would not be hit, the Debugger actually hit the breakpoint during runtime! :D

like image 198
Leniel Maccaferri Avatar answered Oct 10 '22 23:10

Leniel Maccaferri