Alex Rivera | Logout

How to set a breakpoint on a method within the .net framework

Asked 2010-02-03T14:42:22.067
31

I wish to set a breakpoint on the System.Threading.SynchronizationContext::SetSynchronizationContext static method so I can find out when the synchronization context is being set.

However I can’t find how to set a breakpoint in a method I don’t have the source code to.

(This should be easy!, but when I try to set the breakpoint on a method from the breakpoints window it does recognise the method.)

Edit
Report

1 Answer

4

It is possible to debug the .NET framework classes. All you have to do, is setup VS.NET so that it is able to download the debug symbols for the .NET framework from one of Microsoft's servers.

You won't be able to set a breakpoint inside a .NET method though, but, you will be able to step into another method of the .NET framework, and while debugging, and once you've stepped into that method, (and VS.NET has opened the file that contains the SetSynchronizationContext method), you'll be able to set a breakpoint on that method.

For information on how to setup VS.NET so that you can debug the .NET framework, click here

answered 2010-02-03T14:48:21.120

Your Answer