Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Some code debugs, others won't

Status
Not open for further replies.

Craftor

Programmer
Feb 1, 2001
420
NZ
Hi all

Got a bit of a funny one here. I have just created a new .aspx page and, although I put breakpoints in, it does not actually break! Sometimes.

Here's the strange part. If I but a breakpoint in the Page_load event, it will break. If I put a breakpoint in one of my button_click events, it doesn't break - but the code does run (I put in a whole lot of Response.Writes to test) and there is code in the IntializeComponent event to cater for the button_click event.

What's really throwing me is that the Page_load event stops at the break point!

Does anyone know what's going on here, please?

Thanks as always

Craftor

:cool:
 
Sounds like a ghost! heh heh.

I am not sure I have had similiar things happen but my code wasn't running. VS occasionally takes out the Handles... bit on me. The only other thing I can think of is that the break point isn't being hit. Try putting it in different places in the event, or on the event name itself. If I think of something I will get back to you. That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
If I put in a breakpoint while the program is running, it's got a little question mark inside it and the ToolTip reads

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

Make any sense to anyone? Zarcom?

Thanks as always

Craftor

:cool:
 
Most likely somewhere (there are multiple places) the code is specified as a release version not a debug version. This means that as the tool tip said no debug symbols are loaded. Check the drop down at the top of the VS IDE. Make sure it says debug. Also, check in your web.config file to make sure the debug options are set. Mine looks like this.<compilation defaultLanguage=&quot;vb&quot; debug=&quot;true&quot; />
<trace enabled=&quot;false&quot; requestLimit=&quot;10&quot; pageOutput=&quot;false&quot; traceMode=&quot;SortByTime&quot; localOnly=&quot;true&quot; />


And check the properties for your project. Under Configuration properties there is a Debugging Section. Check that.
Also check the configuration manager. (You can get to it from the debugging section)

Hope that fixes things for you.

Oh a side note. I once had a line of code that messed the debugger up for anything within that Function. My other functions debugged fine but not that one. I can't remember what it was any more, I removed it and recoded that sub.

HTH That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
No luck *sniff*

Oh well it works so I spose I shouldn't worry too much ... or else it's back to all those lovely Response.Writes...

Thanks for the time Zarcom

:cool:
 
Gettin the debugger to work greatly increases your productivity in my opinion so don't give up on me now.

Paul (link9) posted this in our tibits thread thread855-288280 you should check out that thread it really is very good.

------------------------------------------------------
&quot;Fixing&quot; your project to hit a breakpoint
------------------------------------------------------

Ever had a little cussing session over your project not hitting a breakpoint when debugging? Breakpoint still have that damned question mark on it, saying that symbols aren't loaded, when you know debugging is enabled?

Just delete the .pdb file (in your /bin) folder, and run it again. Viola.

I guess those things get corrupted sometimes, so just make the system rebuild it from scratch.


paul

ps. the same technique will work on most operating system files, too. I stress MOST (don't go deleting your autoexec.bat)!


Hope you get it :0)
That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Still no luck *deep sigh*

I've deleted the .pdb file, and recompiled several times but no luck.

On the &quot;up&quot; side, the first time I run it after deleting the .pdb file - I get a different message when I hold the mouse cursor over the breakpoint --- &quot;This breakpoint will not currently be hit. No executable code is associated with this line.&quot; then I get back to the usual &quot;no symbols loaded&quot;. *grrrr*

Doesn't it make you want to laugh on a sunny morning ;-)

Thanks for all your time Zarcom.
 
Hmmm seem to found a bit of a workaround ... if I put the following code where I want to break:

System.Diagnostics.Debugger.Break();

it does actually break at that line but still doesn't see the breakpoints I put in myself [hammer]

O well at least I can debug again

:cool:
 
Iteerestings glad you found a way to do it though. That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
I am having _exactly_ the same problem you describe and I haven't found any way of working around it. Thanks for the System.Diagnostics.Debugger.Break() tip!!!!!

I've done ALOT of googling on this problem and none of the tips offered have helped. I haven't found any Microsoft articles on it, which is to be expected, since they don't seem to post bug reports until a solution to the bug exists.

I find it hard to believe that only a few people are having this problem, since both of my development machines, as well as one of my colleagues machines have this issue. And it also happening on all three projects I'm working on.

This is so frustrating, especially considering how excellent the rest of my .Net experiences have been.
 
Hi!
I had the same problem. But I notice on my tool bar next to start button symbol, it changes from debug to Release. Change it back to Debug and it WORKS again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top