How to disable steping into an assembly's source code or seeing "disassembly"

It often happens that one uses an assembly, such as from a 3rd party, where even though you press F11 when over a call to a method from that assembly, Visual Studio just jumps right over that call without trying to jump into that assembly's source.  Somehow VS recognizes that the source code isn't available, or never was available, and this is the preferred action.  

You may say: why not just press F10 / i.e. jump over rather into that call, but often, one line of code will have multiple calls, one of which you WANT to jump into (such as a method in your main project), mixed with calls to dlls that you do NOT want to jump into.  Note that the .NET framework is itself just assemblies.  So often, a call to a method in your project will for instance have as an argument (a parameter) string.Format("", ...).  You of course do not want to jump into the .NET source code of the method Format, and fortunately this doesn't happen.

But the problem is, often when I've made my own assemblies, and use them on the same machine, I cannot figure out how to tell VS I do NOT want to jump into the source code (which is available on the same machine) for this referenced assembly.  Often calls to this external assembly are made within the same line as a call to a method I need to jump into within the same project.  I have tried everything under the sun to get this to work, it seems nearly impossible!  My first step was to delete the pdb file -- but at every rebuild, the stinking project adds the pdb back.  Rename the directory where the source files are -- this quits the pdb file from reappearing in your project for that assembly, but somehow, VS still tries to jump into the source, asking you for the location, or forcing you to view the disassembly, or: stop the program ... no other options!  

I've tried to change every setting possible within Tools>Options>Debugging.  I've tried many other things.  Almost all posts I've seen on this issue has to do with the opposite concern: when someone *wants* to step into the source of an assembly but, for instance, can't locate it.  I've found no one else through google searches, etc, asking this question (which surprises me).

Comments Please!


Who is Participating?
käµfm³d 👽Commented:
Have you looked into the System.Diagnostics.DebuggerStepThroughAttribute? When you decorate a method or property with this attribute, the debugger will not enter the method/property even when Step Into is used. However, breakpoints set within the method/property will still be triggered.
// Example Usage
public void MyMethod()


Open in new window

Sperling1Author Commented:
Now that is quite interesting.  I really appreciate you sharing that kaufmed.  Upon checking it out, it really does not look like it could work though.  It would take tremendous effort to flag every method in the assembly, etc.  But I hadn't thought about a more programmatic solution, more might be found along those lines ... maybe setting a setting within System.Diagnostics could produce the desired result (a totally different route I will note from checking boxes in the VStudio IDE, or messing with Assembly settings)...

Thanks again, still looking.
Sperling1Author Commented:
Was not answered, but I appreciate the idea, and no one else is answering.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.