Click here to Skip to main content
5,785,816 members and growing! (18,649 online)
Email Password   helpLost your password?
Web Development » ASP.NET » Utilities     Beginner License: The Code Project Open License (CPOL)

Session Vizualizer for Visual Studio 2005

By Radu Chirila

Debug tool for analyzing Session content in web applications.
C# (C# 2.0, C#), .NET (.NET, .NET 2.0, .NET 3.0, .NET 3.5), ASP.NET, Dev

Posted: 3 Feb 2008
Updated: 29 Nov 2008
Views: 1,429
Bookmarked: 12 times
Announcements
Loading...



Search    
Advanced Search
Sitemap
9 votes for this Article.
Popularity: 4.61 Rating: 4.83 out of 5
0 votes, 0.0%
1
0 votes, 0.0%
2
1 vote, 11.1%
3
0 votes, 0.0%
4
8 votes, 88.9%
5

Introduction

The purpose of this tool is to let developers easily analyze Session content during debugging and also browse stored objects. For this, a simple interface was built, and a PropertyGrid control is used. In large web applications, there are situations when developers leave old objects stored in the Session, and these are disposed only when the session in ended. Using this tool, it is easy to see the Session content and improve the code that manages Session content.

Background

Visualizers are a new feature in Visual Studio 2005, and allow developers to inspect values at debug time using a graphical interface. These components can be integrated with Visual Studio, and provide extra performance in debugging specific data types.

Built-in visualizers are available for:

  • XML/HTML/Text
  • DataSet/DataTable/DataView

Using the Code

There are three main parts in writing a visualizer:

  • One that implements the IDebugVisualizer interface and runs inside the debugger process.
  • The debugee side that serializes the .NET type to be copied from the debugee process to the debugger process.
  • And, the user interface for showing the debugged object in a nice way.

printscr.jpg

For installing the visualizer, this line can be used:

copy "$(TargetPath)" "$(HOMEDRIVE)$(HOMEPATH)\
                        My Documents\Visual Studio 2005\Visualizers"

This is also used as a post-build event in the attached code to install it automatically after the project is built.

After installing, in order to use it, add the Session object in the Watch window, and click the magnifier icon.

The Session visualizer at this moment has a major drawback: the objects stored in the Session need to be serializable in order to be copied from the application process to the debugger process. Most of the websites use InProc sessions, and objects stored are not always serializable. I think I can improve this in a future version. If you have any idea for improvements, please contact me.

History

First version of this code released on Feb 4th 2008.

I will come back soon with improvements.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Radu Chirila



Occupation: Web Developer
Location: Romania Romania

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
  (Refresh) 
-- There are no messages in this forum --

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 29 Nov 2008
Editor: Smitha Vijayan
Copyright 2008 by Radu Chirila
Everything else Copyright © CodeProject, 1999-2009
Web13 | Advertise on the Code Project