Restrict Visual Studio 2010 from debugging third-party DLL files
Some days back, I had enabled third-party debugging for the Ninject DLL to test some things. Now I am unable to detach the debugger from the Ninject source files and because of that the code is stepping (trying to step if it could not find the source file) into the Ninject source. The same problem is happening for Telerik source code too. I have checked "Enable开发者_C百科 Just My Code (Managed Only)" in the debugging options, but the Visual Studio still steps into third-party code. How do I debug just my code and avoid stepping into the third-party DLL file?
JeffN825's answer didn't work for me either unfortunately.
This did:
Create a post build step for your executable project:
Under Build Events > Post-build event command line, add the following script (replacing with your path) to remove the pdb files following their creation:
ECHO Y | DEL $(SolutionDir)<MyProject>\bin\Ninject.pdb
ECHO Y | DEL $(SolutionDir)<MyProject>\bin\Ninject.Web.Mvc.pdb
Now when I run my project, the Ninject code is not stepped into.
You need to clean the symbol cache for Visual Studio - see Stack Overflow question How do you clear your Visual Studio cache on Windows Vista?.
Also check under Tools -> Options -> Debugging -> Symbols.
and remove and source locations in there that you don't want to debug. And delete the files in the "Cache symbols in this directory" textbox value, and click Empty Symbol Cache (I say to do all of these because sometimes I find it a bit quirky).
Then restart Visual Studio, and make sure your Ninject/Telerik DLL files don't have .pdb files sitting next to them when you start debugging again.
精彩评论