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.
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…”.
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.
Directly to your
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
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
app.UseGlimpse(); to your
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.