Click here to Skip to main content
13,146,315 members (43,373 online)
Click here to Skip to main content
Add your own
alternative version

Stats

9.9K views
492 downloads
29 bookmarked
Posted 10 Apr 2017

Visual Studio Collection Visualizers

Rate this:
Please Sign up or sign in to vote.
Collection Visualizer for Visual Studio 2015 and Visual Studio 2017. Preview your collections in debug mode.

 

Introduction

The last time, a few years ago, I had to develop a .NET solution with a large set off sequences comparisons between them. This sequences was a big sequences and occasionally it was a living hell to check this results.

I decided built an assembly supports for visualize and filter the collection result in debug mode. Sometime afterwards, I updated this assembly to a Visual Studio Visualizer, and today I shared it with you, because I think is a very useful complement.

MLCollectionVisualizers is an open source project and your code is available in Git Hub.

 

Installation

Install MLCollectionVisualizers is very simple. We need to distinguish between Visual Studio 2015 and Visual Studio 2017.

Visual Studio 2015

We must copy the MLCollectionVisualizer2015.dll in this path: 

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Packages\Debugger\Visualizers\

 

Visual Studio 2017

We must copy the MLCollectionVisualizer2017.dll in this path: 

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Packages\Debugger\Visualizers\

Once an assembly has been put in Visual Studio Visualizer path, reboot Visual Studio and our Collection Visualizer will be installed.

 

 

MLCollectionVisualizers

MLCollectionVisualizers is very simple to use. We have to mark our class type with SERIALIZABLE. If someone report any discomfort, we can use the preprocessor directives like in our example:

#if DEBUG
[Serializable]
#endif
public class Album
{
    public int      ID             { get; set; }
    public string   Artist         { get; set; }
    public string   AlbumName      { get; set; }
    public int      Released       { get; set; }
    public string   Genre          { get; set; }
    public decimal  NumberOfCopies { get; set; }
    public int      ClaimedSales   { get; set; }
}

 

Use it is very easy. We put a breackpoint in a collection variable and we do click in the lens:

 

 

As we can see, we can ordered data clicking in ColumHeader of grid.

 

Filtering

MLCollectionVisualizer provide filtering data, this filtered is restricted to the DataColumn.Expression property. Similar to SQL.

We will go the second tab ‘Filters’:

 

‘Filter Info’ LinkedLabel .- Contains a link with filtered information, all instructions and restrictions.

Apply Filter Button .- Executed the filter

Example:

 

In moving:

 

If you type an incorrect syntax filter, it will show the error:

 

In this example the error is ‘=’ symbol.

 

 

Collections Supported

The collections supported for MLCollectionsVisualizers are the following:

  • IEnumerable<T>
  • ICollection<T>
  • IList<T>
  • HashSet<T>
  • ObservableCollection<T>
  • Queue<T>
  • Stack<T>
  • LinkedList<T>
  • IReadOnlyCollection<T>
  • ConcurrentBag<T>
  • ConcurrentQueue<T>
  • ConcurrentStack<T>
  • Array ( T[] )
  • IEnumerable
  • ArrayList
  • HashSet
  • Queue
  • Stack

 

 

Limitations

Not supported x64 Process.

Not supported System.Data.Entities.DynamicProxies of Entity Framework. Entity Framework when we query the database, generic for default this objects with a special characteristics:

 

 

We can fix up this problem, setup our Entity Framework configuration DbContext to ProxyCreationEnabled to false:

 

context.Configuration.ProxyCreationEnabled = false;

 

 

Test Project

Add a test project for this solution and the MLCollectionVisualizers2015.dll and MLCollectionVisualizers2017.dll

 

 

 

License

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

Share

About the Author

Juan Francisco Morales Larios
Software Developer (Senior) Cecabank
Spain Spain
MAP Microsoft Active Professional 2014

MCPD - Designing and Developing Windows Applications .NET Framework 4
MCTS - Windows Applications Development .NET Framework 4
MCTS - Accessing Data Development .NET Framework 4
MCTS - WCF Development .NET Framework 4

You may also be interested in...

Comments and Discussions

 
QuestionQuestion : Will this visualizer work with tuples? Pin
asiwel28-May-17 18:13
memberasiwel28-May-17 18:13 
AnswerRe: Question : Will this visualizer work with tuples? Pin
Juan Francisco Morales Larios30-May-17 0:47
memberJuan Francisco Morales Larios30-May-17 0:47 
GeneralRe: Question : Will this visualizer work with tuples? Pin
Juan Francisco Morales Larios4-Jun-17 1:13
memberJuan Francisco Morales Larios4-Jun-17 1:13 
GeneralRe: Question : Will this visualizer work with tuples? Pin
asiwel23-Jun-17 17:03
memberasiwel23-Jun-17 17:03 
GeneralRe: Question : Will this visualizer work with tuples? Pin
Juan Francisco Morales Larios23-Jun-17 23:26
memberJuan Francisco Morales Larios23-Jun-17 23:26 
QuestionNice visualizer .. but all in Spanish?? Pin
asiwel28-May-17 17:28
memberasiwel28-May-17 17:28 
AnswerRe: Nice visualizer .. but all in Spanish?? Pin
Juan Francisco Morales Larios30-May-17 0:43
memberJuan Francisco Morales Larios30-May-17 0:43 
GeneralRe: Nice visualizer .. but all in Spanish?? Pin
Juan Francisco Morales Larios4-Jun-17 1:04
memberJuan Francisco Morales Larios4-Jun-17 1:04 
GeneralRe: Nice visualizer .. but all in Spanish?? Pin
asiwel23-Jun-17 16:56
memberasiwel23-Jun-17 16:56 
QuestionPrevisualize Error with a Bitmap property Pin
CharleyHagen15-Apr-17 0:28
memberCharleyHagen15-Apr-17 0:28 
AnswerRe: Previsualize Error with a Bitmap property Pin
Juan Francisco Morales Larios17-Apr-17 21:16
memberJuan Francisco Morales Larios17-Apr-17 21:16 
GeneralMy vote of 5 Pin
wsc091813-Apr-17 2:25
memberwsc091813-Apr-17 2:25 
GeneralRe: My vote of 5 Pin
Juan Francisco Morales Larios13-Apr-17 21:59
memberJuan Francisco Morales Larios13-Apr-17 21:59 
Questionx64 process Pin
justAcigar12-Apr-17 19:12
memberjustAcigar12-Apr-17 19:12 
AnswerRe: x64 process Pin
Juan Francisco Morales Larios12-Apr-17 20:57
memberJuan Francisco Morales Larios12-Apr-17 20:57 
GeneralRe: x64 process Pin
justAcigar13-Apr-17 20:49
memberjustAcigar13-Apr-17 20:49 
QuestionConfig file issue Pin
James McInvale12-Apr-17 13:36
memberJames McInvale12-Apr-17 13:36 
AnswerRe: Config file issue Pin
Juan Francisco Morales Larios12-Apr-17 21:05
memberJuan Francisco Morales Larios12-Apr-17 21:05 
GeneralRe: Config file issue Pin
James McInvale13-Apr-17 1:42
memberJames McInvale13-Apr-17 1:42 
GeneralMy vote of 5 Pin
Franc Morales11-Apr-17 15:25
memberFranc Morales11-Apr-17 15:25 
GeneralRe: My vote of 5 Pin
Juan Francisco Morales Larios11-Apr-17 20:38
memberJuan Francisco Morales Larios11-Apr-17 20:38 
QuestionUnable to load the custom visualizer Pin
Darren Schroeder11-Apr-17 3:14
memberDarren Schroeder11-Apr-17 3:14 
AnswerRe: Unable to load the custom visualizer Pin
Juan Francisco Morales Larios11-Apr-17 3:19
memberJuan Francisco Morales Larios11-Apr-17 3:19 
GeneralRe: Unable to load the custom visualizer Pin
Darren Schroeder11-Apr-17 3:30
memberDarren Schroeder11-Apr-17 3:30 
GeneralRe: Unable to load the custom visualizer Pin
Juan Francisco Morales Larios11-Apr-17 4:13
memberJuan Francisco Morales Larios11-Apr-17 4:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.170915.1 | Last Updated 11 Apr 2017
Article Copyright 2017 by Juan Francisco Morales Larios
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid