I am trying to put a breakpoint on below mentioned page in my ASP.Net MVC 2 application\'s .ascx or .aspx files in Visual Studio 2010. But it won\'t let me, it shows:
This problem will happen if you are using Asp.Net Mvc 5 in Visual Studio 2012, but have not installed the proper tooling. For me, this happened because I upgraded my version of Asp.Net Mvc 4 to version 5 via Nuget. However, this did not install the tooling in VS 2012 so that the IDE can properly parse and handle the .cshtml
files. Thus none of the razor code showed up as valid C#, and it was impossible to set any breakpoints (with the error "this is not a valid location for a breakpoint" if you try to set it).
The solution is to install the proper tooling. (or direct link) Once I installed the tooling and restarted VS, I was able to happily set breakpoints in .cshtml
files once more.