How to set breakpoint in cshtml file in Visual Studio 2010?

I am debugging the code contained in the cshtml file in an MVC application. If I insert a deliberate error into the code, then Visual Studio (2010) gives me the opportunity to break this line, after which I can observe local variables, etc. The file is marked as [dynamic] at this point.

I would like to set a breakpoint in the file without breaking the code with a deliberate error, and I thought that I could get a list of loaded (dynamic) files and put a breakpoint in one of them, but if I look for things like "dynamic" and "cshtml", I can’t go anywhere.

I suspect this should be easy, but I can't figure out how to do it! Hope you can help.

+4
source share
1 answer

Yeah! The Solution Explorer has a list of currently loaded scripts in the Solution Explorer under the "Script Documents" section. I tried searching there, but could not find my code, because it is contained in a file called Index.cshtml, but is in the MVC view with the name something else and the name specified in the solution explorer.

+2
source

Source: https://habr.com/ru/post/1389304/


All Articles