Cannot set breakpoint in ASP.NET MVC view when working in IIS7

I have to use IIS7 because Casini is only x86 and we work with x64 ELMAH.

Something that I have noticed since I switched is that I can no longer set breakpoints in ASP.NET MVC views. I'm not quite sure about this because of IIS7, is it? Do you happen to you?

The Visual Studio project (2008) is configured to use local IIS7. Usually I start a project by pressing F5, which actually doesn't start anything. It compiles the code and joins the corresponding IIS7 process.

Limiting breakpoints in my environment is now very tough . If I right-clicked a piece of code in the view, the "Breakpoint" submenu, as before, was using Insert Breakpoint. But when I try to insert a breakpoint, I get a blue message at the bottom of Visual Studio saying:

This is not a valid breakpoint location.

and no breakpoint is set. Setting breakpoints in compiled code, like the controller, is not a problem.

Is there any way to decide to set a breakpoint in the view?

+3
source share
6 answers

You need to make sure that you are breaking what is actually a server!

You obviously cannot break:

<h2>Title<h2> 

And, perhaps surprisingly, you cannot break:

 @SomeCode here 

But you can break:

 @{ SomeCodeHere } 
+6
source

You can try connecting the process (Ctrl + Alt + P) to w3wp.exe and start it from there. If more than one w3wp.exe process is running, check out the tips from the InfoPath MSDN Blog .

However, being β€œforced to use IIS7” over Cassini, it seems like he is forced to choose ice cream over raw sewage.

0
source

Try running VS as an administrator, I ran into this problem trying to connect to IIS7 w3wp.exe. I started working as an administrator and worked perfectly.

0
source

I had the same problem, after which I installed ASP.NET 5 RC1 Update 1, everything got worse.

I solved the problem of deleting the ComponentModelCache folder from the% appdatalocal% / Microsoft / VisualStudio / 14.0 folder.

0
source

Can you set breakpoints elsewhere in your code?

I never set a breakpoint in one of my views, did you try to set a breakpoint in the controller on a line that returns the view, and then tried to enter the view from there?

What are you trying to debug in your view? It should be clean and simple, without logic. That's why I never had to debug it.

-1
source

Include line numbers for HTML here

 Tool -> Options -> Text Editor -> HTML -> General 
-3
source

All Articles