TOD : Wrapping Code Block and Statements in Visual Studio

In this tips I have explained how you can automatically wrap up code blocks or code statement in Visual Studio. We can use Document formatting to format the whole contents, but that doesn’t wrap single line code block like Properties or not even single line multiple declaration statement.  Let’s consider an example, you are creating a Properties using code snippet and by default it will came up like

image

But, you want you code to be look like as below

image

How ? Read Complete Tips

Tips on Debugging : Using DebuggerStepThrough attribute

In my few previous blog post I have explained  how we can customize the Debugging windows view during debugging of application using “DebuggerBrowseable “  attributes and “DebuggerDisplay” , then I have also explained use of “DubuggerHidden” attribute which tells the Visual Studio debugger that the method is hidden from the debugging process and while debugging. In this blog post I am going to explain one similar features of “DebuggerHidden” attributes, named “DebuggerStepThrough” 

Marking a piece of code using DebuggerStepThrough attribute tells the Visual Studio debugger that, the code block will be stepped over from debugging process. you can mark methods, properties with DebuggerStepThrough attributes where you don’t want to stop your code to break.

If there is any break point inside a code section which is marked as “DebuggerStepThrough” attributes, that code block will be marked as “[External code]” in stack Trace. Where as “Debugger hidden” attributes didn’t marked is External code.

overall

Continue reading

Tips on Debugging : Using DebuggerHidden attribute

DubuggerHidden attribute tells the Visual Studio debugger that the method is hidden from the debugging process and while debugging. This is quite helpful when you don’t  want to go to stepping inside of a method while debugging.

When you mark a method with DebuggerHidden() attributes,  It’s explicitly tells the debugger not to step inside of that methods and no break point will be hit over that method. Now I am going to explain the same using a Example with Intellitrace debugging.

1

Continue reading

Few Tips on Customizing Debugging Window View in Visual Studio

In this post I am going to discuss about few tips on customizing debugging debugging windows. This may be very helpful during debugging of application. While debugging, you may want to simplify debug window or you may want to clean up all the unnecessary fields that are not important during debugging from debugging windows.  Here is few tips for customization of debug window. 

lightbulb Use DebuggerBrowsable attribute to customize the debugging windows

2

lightbulb  Use DebuggerDisplay attribute to customize the debugging display.

 1

 

To use above attributes you have to use System.Diagnostics namesapce

Continue reading