Issues with debugging an asp.net project

  • Thread starter Thread starter Ken Dourado
  • Start date Start date
K

Ken Dourado

Hi,

I have an issue debugging my asp.net project. On a particular aspx
page, in the code behind cs file, my breakpoints are not being hit. The
breakpoint is in the Page_Load() method and is a proper line of code
where a variable is assigned a value (not a blank line, curly brace or
anything else).

Breakpoints on other .cs code behind files pages in my project are hit
without any problems, the issue is with this single page.

I have set VS.NET up in debug mode (not release), the web.config file
has debug set to true and my project debugging configuration properties
have 'Enable ASP.NET Debugging' set to true. I have also added
debug=true to the page directive in the aspx file.

I am not getting anywhere.

I'd appreciate any help or advice.

Thank you,

Ken Dourado.
 
Ok, the breakpoints aren't reached, but is the code executed anyway? I mean,
is the code in the Page_Load executed? To be sure about that, you can place
a Response.Write in it.

If the breakpoint isn't reached AND the code isn't executed, it is most
likely that your Page_Load is not called. This may be due to a bug in Visual
Studio.net, where it removes the event handlers:
-if using VB.Net, check that the "Handles Page.Load" wasn't removed at the
end of the Page_Load declaration
-if using C#, check that the Page.Load += new EventHandler(Page_Load) is
still there in the hidden code part of the CodeBehind file.
 
Arnaud,

Thanks for that - the change worked. I don't think I'll ever forget to
check that now if it ever happens again.

Regards,

Ken.
 
Back
Top