Getting Started With Glimpse In ASP.NET MVC
Join the DZone community and get the full member experience.Join For Free
if you are using asp.net, especially if you are using asp.net mvc, you need to be using glimpse .
i’m currently working on a more exhaustive pluralsight course on glimpse, but i thought i’d write up a quick getting started tutorial here.
what is glimpse?
perhaps you haven’t heard of glimpse yet, or you are just a little unsure of exactly what it is.
glimpse is basically an open source and free diagnostics platform for the web. right now it works best with asp.net and especially asp.net mvc, but it can be extended to other platforms as well. there is already work started for a php version and even a python port .
out of the box, glimpse can show you all kinds of information about your mvc application, like what routes are registered, what the flow was through the mvc pipeline and how the models were bound.
(btw, if you are looking to brush up on your asp.net mvc 4 skills or learn about asp.net mvc 4, i recommend professional asp.net mvc 4 . great book, top notch authors.)
here is what the glimpse window looks like on a page.
glimpse is also fully extendable.
there are already plugins for entity framework, nhibernate, ninject and many, many more
the best part about glimpse is how easy it is to get setup.
i’ll walk you through the steps below.
step 1: get glimpse from nuget
all you have to do to get glimpse installed is simply either:
- open up the package manager console and type “install-package glimpse.mvc4” (or “glimpse.aspnet ” if you aren’t using mvc)
- or, right click on your references, select manage nuget packages, then search for glimpse and find the appropriate glimpse package.
one you’ve done that, glimpse will automatically add a few entries to your web.config for you.
step 2: turn on glimpse
turning on glimpse is super easy.
just launch your app and navigate to glimpse.axd . then, click “turn glimpse on” to set a cookie that will tell the glimpse component running on the server to send you glimpse data.
go to glimpse.axd
turn it on!
it’s that simple!
step 3: fire it up
now all you have to do is navigate to any page in your application and you’ll see this little icon at the bottom right hand corner of the screen:
if you click the icon, you’ll see the glimpse panel, which currently looks similar to the chrome dev tools panel.
each tab contains different diagnostics information about your application.
this data can be extremely helpful in troubleshooting problems and learning about exactly what is going on inside of mvc.
you can also find plugins that can be easily installed from nuget.
for example, if you add the entity framework plugin, you’ll start seeing a tab that shows data about ef queries, like this:
i’m pretty excited about glimpse and its future. anthony van der hoorn and nik molnar , the two creators and main maintainers for glimpse, have done an excellent job transforming how we get diagnostics information for web applications.
one of the things i find most exciting about this platform is how easy it is to extend. in my upcoming pluralsight course , i walk you through creating a glimpse plugin, which is surprisingly easy.
so if you haven’t checked out glimpse, what are you waiting for? go do it now, it will take you about 5 minutes to get setup.
what do you think? are you using glimpse already? post a comment and let me know.
Published at DZone with permission of John Sonmez. See the original article here.
Opinions expressed by DZone contributors are their own.
How To Become a 10x Dev: An Essential Guide
Does the OCP Exam Still Make Sense?
Implementing a Serverless DevOps Pipeline With AWS Lambda and CodePipeline
HashMap Performance Improvements in Java 8