2

I have an MVC web application. I get an "Object reference not set to an instance of an object" error in line 16 below. It's a master page file. When I try to place a breakpoint in that line or anywhere in the file, I get a "this is not a valid location for a breakpoint" error. I have clicked on every line and I can't place a single breakpoint. I do have lines which have code only.

How do I place a breakpoint in this file?

Note: I can place breakpoints in code files. In some other aspx files, I can place a breakpoint in some code lines and some not. Does the inline code have to be in a special format to place a breakpoint? Using VS 2010 in Windows 7 64bit.

Code:

Line 14:   <div id="<%= Model.PageWidth %>" class="<%= Model.PageTemplate %>">
Line 15:     <div id="hd">
Line 16:       <h1><a href="/"><%= Model.Workspace.Title %></a></h1>
Line 17:       <h2><%= Model.Workspace.Subtitle %></h2>
Line 18:     </div>
Jason Berkan
  • 8,734
  • 7
  • 29
  • 39
Tony_Henrich
  • 42,411
  • 75
  • 239
  • 374

2 Answers2

2

Look at this post: Break points aspx pages

Community
  • 1
  • 1
Dustin Laine
  • 37,935
  • 10
  • 86
  • 125
2

If you are developing locally the "Script Documents" will show up under "Windows Internet Explorer" and you can add the breakpoint on the dynamically generated file there.

Sameer Alibhai
  • 3,092
  • 4
  • 36
  • 36