2

I'm working on a Web Site Project as opposed to a Web Application Project. As such, there is no project file to build and produce a .dll library file or .pdb debugger symbols file.

Right out of the box, if I create a brand new web site project, try to set a breakpoint anywhere, and run with the debugger on, I get the following message:

The breakpoint will not currently be hit. No symbols have been loaded for this document.

Screenshot

I must be overlooking something simple, because there must be a way to debug an ASP.NET Web Site. Right?

Steps to reproduce:

  1. Open Visual Studio (confirmed in 2010 and 2008)
  2. Create New Web Site Project
  3. Select ASP.NET Web Site
  4. Add a Load Event handler to Default.aspx.vb
  5. Run with Debugger F5
  6. This will prompt you to have <compilation debug="true" /> in your web.config if you don't already, select yes.
  7. Debugger symbols will not be loaded for the page because it is compiled on the fly
KyleMit
  • 30,350
  • 66
  • 462
  • 664
  • 1
    I think this might help if you havent treid any of them yet .http://stackoverflow.com/questions/2446756/why-am-i-unable-to-debug-my-asp-net-website-in-visual-studio – dotnetstep Dec 31 '14 at 15:25
  • Is debug set to true in your web.config? How are you running the project? Are you attaching to an IIS working process? I also get this message when debugging my web site projects, if my breakpoints are set on files that are not currently loaded onto the page. My breakpoints are hit though when i navigate to a page when that file gets loaded. – austin wernli Dec 31 '14 at 15:27
  • @dotnetstep, almost all of the debugging questions on StackOverflow (that one included) are geared towards Web Applications. On a web site I cannot do things like clean/rebuild etc. – KyleMit Dec 31 '14 at 15:28

1 Answers1

2

You might need to actually put the breakpoint inside the method, as you're saying "break before this line is executed". On function declaration, how do you break before that line?

Protected Sub Page_Load(sender As Object, e as System.EventArgs)

   ' Some Page load task - try setting your break point here.

End Sub
KyleMit
  • 30,350
  • 66
  • 462
  • 664
Kritner
  • 13,557
  • 10
  • 46
  • 72
  • heh thanks for the edit, I don't really know much of VB syntax :P Seems like in VS2012 (C# anyway) you'll get that same warning, but the breakpoint will hit on the bracket opening the function. Don't know if the same holds true for VB, but putting the break *in* the function itself will do it :) – Kritner Dec 31 '14 at 15:40
  • By the way, if it shows that error at first when debugging, it will clear as symbols continue to be loaded into IIS. – Aaron Thomas Dec 31 '14 at 17:35