ASP.NET MVC–Model Error Visualizer

To scratch my own itch (so to speak), I created a Visual Studio visualizer for ASP.NET MVC, allowing ModelState errors to be seen at a glance. This is particularly useful when debugging async requests when and modelstate are not displayed on screen. The visualizer works on the ModelStateDictionary type, iterating through the dictionary and presenting any errors and the associated property name in a datagridview (see the below screenshots).

I built this with VS2012 RC, but the code is simple enough that it should be trivial to modify it to work with older version of VS. The code and download are up on github. Just drop it into your Visual Studio 2012 Visualizers folder and you should be good to go. Feel free to use and abuse (and fork) it in whatever way your heart desires.

 

Links

https://github.com/irwinj/ModelErrorVisualizer

https://github.com/irwinj/ModelErrorVisualizer/downloads

Visualizer in debug mode

 

image

 

Example

For example, when I turn client-side validation off on the default Razor web application and forget to enter a password, I get the following:

screenshot

Post a Comment

Popular posts from this blog

Getting Started with Mirth (Part 2)

Mirth

Visual Studio 2012–Debug in Chrome Incognito Mode