Debugging Visual Studio Generated Strongly Typed DataSet Code

Tuesday, March 4, 2008

Sometimes you may face a situation when you need to debug Visual Studio generated code. For example, when you create strongly typed DataSets, Visual Studio generates corresponding code.

If you put a break point in such code, to your surprise the debugger will not fire it. This happens because the v2.0 CLR debugging services has a feature called Just-My-Code (JMC for short) debugging. By default this is enabled in Visual Studio. Hence, all code (methods) marked with System.Diagnostics.DebuggerNonUserCodeAttribute will be ignored by the debugger and no break points set in such code will be fired.

This is a pretty nice feature to avoid needless stepping in 3rd party code and Visual Studio generated code as well. However, as mentioned above, sometimes we need exactly the opposite, i.e. to be able to debug the Visual Studio generated code.

You can disabled JMC in Visual Studio options as shown on the screen shot below. Simply, clear the Enable Just My Code (Managed only) check box.


Mike Stall has a pretty nice article about JMC in his blog, which you can find here:

9 comments:

said...

This comment has been removed because it linked to malicious content. .

said...

See

said...

See or

said...

SECURITY CENTER: See Please

said...

See Please

said...

It doesn't work!

I don't know what I'm doing wrong, but I'm debugging a web service, and it uses a typed dataset, and the damn thing goes into the code every time. And Just My Code is properly CHECKED in the Tools/Options/Debugging.

My friend is experiencing the same thing, and he's debugging a web app (not a web service) in case that makes a difference.

I *think* the attribute is respected with winforms debugging but I'm not sure ...

said...

Nope. It doesn't work for winforms debugging either. And the CLR debugger also has this failing.

said...

Hi i am kishore and i have a blog with good traffic, shell we have link exchange.On my blog i am providing s60v3 applications and keygens and my blog is

said...

Hey man,

great blog, some really good information in this, i too was a programmer so i know it can be restrictive in meeting new women in that environment, i now run which teaches guys how to approach and attract beautiful women with demonstrations right in front of your eyes, please check out the link.

rob