ASP.NET Class Library not hitting break points

2020-03-31 04:04发布

问题:

I have an ASP.NET web aplication using vs2008. It used to let me hit my break points but for some unknown reason in this site it won't let me hit them any more. I have set everything to debug and re built about a million times and everything else but can't seem to hit that damn break point!!! Break points work for the site but not the class libraries I add in, but they used to!!

I can't see anything in the web config or the configurations to change anything. I've added the class library to a test solution, works fine.

Does anyone have any ideas?

回答1:

Just to confirm, breakpoints work for the site but not for the class library. That means VS is attaching to the right instance. Put a break point right before the class library is invoked and see if it will drill in. If visual studio can't generate the metadata for debugging, it does a jump over. Confirm you also have the PDB file from the class library present. Also, if you've recently updated the class library, be sure to stop Cassini and restart.



回答2:

I've recently just written about this, but it basically boils down to VS getting attached to the wrong instance of IE. Try closing every single instance of IE down and try again.

There are many other reasons, but you should try this first.