Visual Studio: Custom debugger visualizers. Creating Debugger Visualizers with Visual Studio : Introduction Code debugging is one of the most important.

Slides:



Advertisements
Similar presentations
Getting started with MPLAB Launch MPLAB Set Toolbar as in the next slide by clicking the leftmost icon Open a new Source file by choosing [FILE][NEW] Type.
Advertisements

Creating a Dialog-Based Comet Windows Program Brian Levantine.
KompoZer. This is what KompoZer will look like with a blank document open. As you can see, there are a lot of icons for beginning users. But don't be.
Calendar Browser is a groupware used for booking all kinds of resources within an organization. Calendar Browser is installed on a file server and in a.
Instructed by: Ofir Erel Performed by: Adam Levi Marina Skarbovsky.
Creating Custom Forms. 2 Design and create a custom form You can create a custom form by modifying an existing form or creating a new form. Either way,
The IDE (Integrated Development Environment) provides a DEBUGGER for locating and correcting errors in program logic (logic errors not syntax errors) The.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Data Forms in Hyperion Planning. Data Forms are used by the business users and planners to enter, update and analyze the data. Actually, data forms.
Visual Studio 2005 C# IDE Enhancements Luca Bolognese C# Program Manager Microsoft Corporation.
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
Open and save files directly from Word, Excel, and PowerPoint No more flash drives or sending yourself documents via Stop manually merging versions.
Aptech Borivali(West) Hefin Dsouza. Agenda  What is.NET and What is Visual Studio? .NET Framework 3.5 Overview.  Visual Studio 2008 Enhancements. 
XP New Perspectives on Microsoft Access 2002 Tutorial 71 Microsoft Access 2002 Tutorial 7 – Integrating Access With the Web and With Other Programs.
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
1 ENG236: ENG236: C++ Programming Environment (2) Rocky K. C. Chang THE HONG KONG POLYTECHNIC UNIVERSITY.
A First Program Using C#
11 Games and Content Session 4.1. Session Overview  Show how games are made up of program code and content  Find out about the content management system.
Introduction to VB.NET Tonga Institute of Higher Education.
NOTE: To change the image on this slide, select the picture and delete it. Then click the Pictures icon in the placeholder to insert your own image. WEB.
IE 411/511: Visual Programming for Industrial Applications
StyleCop Breaking down the barriers to entry Gary Ewan Park Twitter: Blog:
Lecture 1 Programming in C# Introducing C# Writing a C# Program.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 2 Welcome Application Introducing the Visual Basic 2008 Express Edition IDE.
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
Lecture Set 2 Part B – Configuring Visual Studio; Configuration Options and The Help System (scan quickly for future reference)
Scalable Game Development William Roberts Senior Game Engineer
A1 Visual C++.NET Intro Programming in C++ Computer Science Dept Va Tech August, 2002 © Barnette ND & McQuain WD 1 Quick Introduction The following.
Namespaces Tonga Institute of Higher Education. Introduction to Namespaces The.Net Framework provides many classes for doing different things  File Input/Output.
New team member / new project for the team Helps analyze relationships and structure Understanding code Locates code in unfamiliar code bases Understand.
NOTE: To change the image on this slide, select the picture and delete it. Then click the Pictures icon in the placeholder to insert your own image. WEB.
Active-HDL Interfaces Debugging C Code Course 10.
Visual Basic.NET BASICS Lesson 1 A First Look at Microsoft Visual Basic.NET.
Debugging Visual Basic.NET Programs ► ► Use debugging tools ► ► Set breakpoints and correct mistakes. ► ► Use a Watch and Local window to examine variables.
Microsoft Visual Basic 2005 BASICS Lesson 1 A First Look at Microsoft Visual Basic.
Guide for Mahara My Views PY1 team 3 - Yihong Huo, Jian Ren, Poonam Kala 1Guide of My Views - Team 3.
Separating the Interface from the Engine: Creating Custom Add-in Tasks for SAS Enterprise Guide ® Peter Eberhardt Fernwood Consulting Group Inc.
Introduction to EBSCOhost Tutorial support.ebsco.com.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 8: Working with Style Sheets.
This is how you invoke the Microsoft Visual Studio 2010 Software. All Programs >> Microsoft Visual Studio 2010.
Object-Oriented Application Development Using VB.NET 1 Chapter 2 The Visual Studio.NET Development Environment.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files 8/10/ :35 PM.
Open project in Microsoft Visual Studio → build program in “Release” mode.
+ Publishing Your First Post USING WORDPRESS. + A CMS (content management system) is an application that allows you to publish, edit, modify, organize,
CSC 1201 LAB RULES Nouf Aljaffan (C) CSC 1201 Course at KSU.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 6 1 Microsoft Office Access 2003 Tutorial 6 – Creating Custom Forms.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
Integrating and Extending Workflow 8 AA301 Carl Sykes Ed Heaney.
MICROSOFT ACCESS – CHAPTER 3 CONTD. Sravanthi Lakkimsetty Mar 09, 2016.
Visual Programming Borland Delphi. Developing Applications Borland Delphi is an object-oriented, visual programming environment to develop 32-bit applications.
What's New in Visual Studio 2010 Debugging Brian Peek Senior Consultant, ASPSOFT, Inc. Microsoft MVP - C#
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Source Code Inspection and Software Reuse
Introduction ITEC 420.
DotNetSpider Editor Hefin Dsouza
Computer Software: Programming
Introduction to .NET Framework Ch2 – Deitel’s Book
Quick Start Guide for Visual Studio 2010
Mobile Application Development with MeeGo™ - Programming with SDK
Microsoft Office Access 2003
Microsoft Office Access 2003
1. Open Visual Studio 2008.
DEV354 Visual Studio 2005: New Enhancements For Debugging Applications
The Role of Command Line Compiler (csc.exe)
Tutorial Introduction to help.ebsco.com.
MS Confidential : SharePoint 2010 Developer Workshop (Beta1)
Presentation transcript:

Visual Studio: Custom debugger visualizers

Creating Debugger Visualizers with Visual Studio : Introduction Code debugging is one of the most important parts of any development life cycle because it gives you the technique to find the problem and how to resolve it. When we talk about the visual debugging Visual Studio has tremendous potential in the term visual debugging features in the form of DataTips. DataTips tool provide a handy way to view information about your variables in visual studio during debugging only. In old versions of Visual Studio DataTips were limited in the amount of the information they could display. Now in Visual Studio particularly after VS2005 DataTips have been enhanced to give more detail information about the simple and complex variables. By the help of DataTips tool programmer easily visualize different variable data types in their Visualizers. One of the very many cool new features in Visual Studio 2005 is the debugger visualizer. With debugger visualizers, developers are able to define what information they would like to see about a particular.NET class or even one of their own classes during debug mode. And as the name suggests, you can also choose how you would like to visualize these details.

Visual Studio has some pre-existing visualizers that you will discover during debug mode. You can access the visualizers by using a dropdown list on the left side of the new DataTips between the selection and its value. For example, if you point to a string object in Debug mode as in below snapshot, you will have access to three pre-existing debugger visualizers: Text, XML and HTML. You can also access visualizers through the Watch windows. Figure 3 shows the DataTip's Watch window where you can see the _stringvalue property of a StringBuilder object. When you select the XML visualizer, you will get a better view of the XML-formatted string, demonstrated in below figure:

4 An XML visualizer displays XML in a format that is perfectly readable. Another handy visualizer that Microsoft has already written and included with the Beta1 version of Visual Studio is for DataTables and DataSets. Something that surely many developers have considered this visualizer presents a quick way to see the contents of a DataTable. Though they are named "DataSet visualizer" and "DataTable visualizer," they present the same UI. These two visualizers are read-only. The screenshots in a DataSet visualizer in Figure 5 and Figure 6 show how you can select the various DataTables within a DataSet to view. Microsoft has also provided pre-written visualizers for DataSets and DataTables.

5 The Dataset and Datatable visualizer shows a grid view of the actual data. You can access all Datatable(s) in a Dataset through the Dataset visualizer's interface:

6 The real beauty of debugger visualizers is that you can write your own. You can create debugger visualizers to display information about.NET Framework classes or your own custom classes. Debugger visualizers inherit from the DialogDebuggerVisualizer class which is part of the Microsoft.VisualStudio.DebuggerVisualizers assembly. Note that Microsoft did not include this assembly with the current Express versions of Visual Studio. Since you will need to compile and deploy your visualizers, they are not written in the same project or the same solution as the projects that will actually use them. After you write the required code to identify the visualizer and what class it will work with, you can write whatever code you wish to create the display information. As an example, the next-coming snapshots (i.e. Figure-A and Figure-B) demonstrate two custom visualizers that show some helpful metadata about a Datatable object: “Out-of-the-box" Visualizers : Roll Your Own Visualizers using C#

7 Figure – A (This custom visualizer displays useful metadata of a DataTable inside a MessageBox): Figure – B (This custom visualizer displays useful metadata of a DataTable inside a Win-Form):

8 With the pre-existing visualizers given by the Visual Studio Framework, if someone wants to debug/see the content of an Image’s object, one can not see any visualizer for this image object: Please note that In the above image Visual Studio debugger not able to load image visualizer because as there is no visualizer available. But you can also customize the visualizer to debug the image data to view the exact image and its other details like height and breadth features. When you debug the image and click “Image Visualizer” option as below:

9 You will get the image in debug-mode, on windows form as:

10 Building a Debugger Visualizer A few ground rules: Each debugger visualizer is a separate class. You can combine multiple debugger visualizers for the same class into one project/assembly. Debugger visualizers for different classes must reside in a separate project. You may have multiple assemblies targeted to the same class. To write a custom Image visualizer, please follow the following steps: 1.Create a Class Library project in Visual C#. 2.Name it “ ImageVisualizer ”. 3.Add following Assemblies References. a)Microsoft.VisualStudio.DebuggerVisualizers.dll b)System.Drawing.dll c)System.Windows.Forms.dll 4.Rename the class1 to ImageDebugger.cs 5.Your class must inherit from the DialogDebuggerVisualizer class and also must override the Show method from that class.

11 Your code will look like : Please add one assembly as shown below so that it helps your DLL to be recognised as one of debugger visualizers and after doing your custom coding, build this to have updated DLL

12 Deployment of Visualizer Copy the DLL to either of the following locations: Install path\Microsoft Visual Studio 9\Common7\Packages\Debugger\Visualizers\ — or — My Documents\Visual Studio 2008\Visualizers\

13 Test Visualizer (Custom) Please follow the following steps: 1.Create a new VS solution and project (Windows Forms Application) 2.Give it name as “ImageVisualizerDemo”. 3.And write the following code and set the breakpoint on as below snapshot: Run the program and you will find debugger on the breakpoint as below:

14 You can clearly see the new Image Visualizer in the preceding image and click on the magnifying glass icon and get output, as below:

15 Conclusion This feature was first introduced in Visual Studio 2005 onwards. With all that is new and exciting feature about Visual Studio.NET. Hope the team members developers will realize the beauty of this class. Sample code will be available for your further reference, if anybody is interested. Some useful links for your reference:   

16 “ Thank You ”