Geeks With Blogs
Teucer's Quiver Me && .net

Today I was debugging some code and was not able to break into some code of a component; the debugger just failed to recognize it. Turns out the method was decorated with the [DebuggerNonUserCodeAttribute]. Its a neat way to restrict code from being debugged/stepped into. The attribute can be applied to structs, classes, methods, properties and as one may guess not for interfaces. Do note that these attributes are useful only to debugging tools so if you end up writing an implementation for ICorDebug :) you can very well ignore these attributes.

Mike Stall has a relevant post aptly named "How can I debug Just My Code?". One may also want to read about what's new in 2.0 debugging...

 

And today I am thinking about whether to use Typed Datasets or not to build the data access library for the local storage POC I am involved in... may be more info in a future post...

Posted on Thursday, November 16, 2006 7:15 PM | Back to top


Comments on this post: DebuggerNonUserCode attribute

# Re
Requesting Gravatar...
And this can also be used in hide the auto generated code from the code coverage. Quite useful
Left by Jack on Nov 19, 2010 12:58 AM

Your comment:
 (will show your gravatar)


Copyright © Tameem Ansari | Powered by: GeeksWithBlogs.net