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

折月煮酒 提交于 2019-12-10 02:51:55

问题


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:

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

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?


回答1:


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



来源:https://stackoverflow.com/questions/22924809/breakpoint-in-asp-net-mvc-razor-view-will-not-be-hit-no-symbols-have-been-loade

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!