SIGN UP MEMBER LOGIN:    
ARTICLE

Debugger Canvas in Visual Studio 2010; A New Debugging Tool

Posted by Suthish Nair Articles | Visual Studio 2010 June 15, 2011
This article explains about a new powerful debugging tool introduced in Visual Studio 2010 Ultimate called Debugger Canvas.
Reader Level:
Download Files:
 

Introduction

Tool Release Date: Jun 15 2011

This article explains about a new powerful debugging tool introduced in Visual Studio 2010 Ultimate called Debugger Canvas

A new debugging tool in the debugger for Visual Studio users is used to debug code when stepping through each line of code

It pulls together the code you want to debug onto a single block or canvas or a new term bubbles with zoom display. 

When you hit (F5) and set breakpoints (F9) or step into code (F8/F10), Debugger Canvas shows just the methods or functions 

that you're debugging even with call lines and local variables. It will be a new user experience, I liked it J

a new refreshing tool introduced by Microsoft. Debugger Canvas was built on top of Visual Studio 2010 Ultimate.

 
Prerequisites


Why only Visual Studio 2010 Ultimate
 

As per MSDN Forums:

"The reason we require Ultimate is so that we could re-use the underlying technology for the Dependency Diagrams 

  to identify and display the right fragments on the canvas."


I yet to explore Dependency Diagrams, hope MSDN link provided above will help you.


Another important thing I observed is that the tool only supports code files, no designers or other external files other than code files.

 

Features of Debugger Canvas

  • Am sure you all going to love these features.
  • A new rich debugging experience.
  • A new interface named Canvas or bubble window.
  • Instead of breaking each code file where the methods resides, a new code bubble window with all methods will get opened.
  • While stepping through the code Debugger Canvas will open each method in a new code window.
  • Each new code bubble window will open an editor window the same as code behind files.
  • We can edit the code logic on runtime directly on canvas.
  • We have call stack, local variables, can set breakpoints through debugging window.
  • We can set or save each line variable values and compare with old one etc and more.


Getting StartedDownload the .vsix Visual Studio 2010 Extension file from the above link. Just double-click on the Microsoft.DebuggerCanvas.vsix installation file.


11.jpg

22.jpg

You can check the successful installation of extension by opening Extension Manager from Tools menu. We can even disable or uninstall the file from listings.

33.jpg

And also, go to Debug menu and Debugger Canvas.

44.jpg

Now restart you Visual Studio and create a console application.

 

Example 1

Follow this simple sample code which prints Hello World!Program.cs


55.jpg

Now put a break point on line number 13 and F5. Start debugging the code by pressing F8/F10 according to VS keyboard settings on your system. 

Now you will see a new code bubble window open like below.

66.jpg

Further debugging will open a new code bubble window with Display method. Hit F5 to run for the output.

77.jpg

Example 2

Let's work with another sample. Introduce a new code file which returns a simple string value.CodeFile1.cs


88.jpg

Program.cs

99.jpg

Put a breakpoint on line number 10, run the project and start debugging line by line until the output displays. The newly generated Canvas will look like below.

111.jpg


Edit the code on runtime


Go to Tools --> Options --> Debugger --> Debugger Canvas, then enable the check box to allow editing.

444.jpg  

Now how to edit the code on runtime, it's simple by just clicking on any bubble editor window and change the code and re-run the project.

222.jpg

After clicking on the above icon to expand, we can see the values for variables at different timings (click on camera icon).

333.jpg

Conclusion

Hope this article helps you all in understanding Debugger Canvas in Visual Studio 2010 Ultimate. 


More articles are coming on this topic so keep checking for my next one. 

Sample code is attached, try at your end and let me know the experience of using this powerful tool. 

Keep commenting and rate the article.

Thank You !

Login to add your contents and source code to this article
share this article :
post comment
 

Thank you!

Posted by Suthish Nair Aug 12, 2011

Clear and easy to understand

Posted by Dimpal Mistry Aug 09, 2011

simple and clear!

Posted by al gor Jun 21, 2011

Nicely placed!!!

Posted by Karthikeyan Anbarasan Jun 16, 2011

Hey it's very nice debug tool for developer.

Posted by Krishna Garad Jun 16, 2011
Team Foundation Server Hosting
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor