Installing Glimpse v2 Beta1

Yesterday we launched Glimpse v2 Beta1 for ASP.NET 5 and we couldn’t be prouder of this achievement. Over the course of the coming weeks and months we will be sharing lots of tips and tricks on how to use and optimize all the new features of v2. Today, however, we thought we’d start with the absolute basics – how to install it.

Here is Scott Hanselman talking about Glimpse v2 at the ASP.NET 5 RC1 launch at //Connect();.

Here is Scott Hanselman talking about Glimpse v2 at the ASP.NET 5 RC1 launch at //Connect();.

Installing v2 couldn’t be easier. You just need to add the “Glimpse” package to your web project and then add Glimpse to your Startup.cs. This post contains a detailed walkthrough of these steps, just in case you aren’t all that familiar with ASP.NET 5 yet.

NOTE: This release of Glimpse v2 targets ASP.NET 5 RC1 (either Core or full CLR). In the a future release Glimpse v2 will extend support for earlier versions of .NET.

Adding Glimpse Package

Adding the Glimpse package to your web project is quite simple. It can be done either by the new “NuGet” dialog window or directly by updating your project.json. See details on both options below.

“Manage NuGet Packages” Option
If you go down the dialog route, simply right click on your target web project and select “Manage NuGet Packages…”.
Screen Shot 2015-11-19 at 6.41.44 AM
Once the dialog opens, make sure you select the “Include Prerelease” checkbox, and then search for “Glimpse”. Then select the package named “Glimpse” and “Install” it into your project.
Screen Shot 2015-11-19 at 6.42.55 AM

Directly to your project.json Option
It is just as easy to add glimpse via the project.json directly. To do this simply add glimpse to the root dependencies section of your project.json and add "Glimpse": "2.0.0-beta1".
Screen Shot 2015-11-19 at 7.06.34 AM

Updating your Startup.cs

Once the package is referenced in your project, you need to update your Startup.cs so that Glimpse is hooked into your application. Specifically, services.AddGlimpse(); needs to be added to your ConfigureServices(...) method (to register our services with the ServiceCollection) and app.UseGlimpse(); to your Configure(...) method.
Screen Shot 2015-11-19 at 8.29.11 AM

Run your site

Once the above steps are complete, Glimpse will be turned on by default for any request you make from “localhost” moving forwards. This “localhost” restriction can be lifted and other restrictions added in its place or in addition. Look for more details on these configuration and extensions options coming soon.

Screen Shot 2015-11-19 at 8.36.05 AM

If you would like a sample application that already has Glimpse configured and running, feel free to download the Glimpse source and try out the various sample projects.

3 thoughts on “Installing Glimpse v2 Beta1

  1. Søren Reinke

    Hi there

    I did follow your guide, but nothing has changed when running the site.

    No meter at the bottom or anything.

    Any tips?

  2. Pingback: The Morning Brew - Chris Alcock » The Morning Brew #1973

Leave a Reply

Your email address will not be published. Required fields are marked *