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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.