Search code examples
c#asp.netvisual-studioglimpse

Glimpse causes 500 error on images and CSS


I'm installing Glimpse on a .NET 4.6 project, but when I install the Asp.Net package from NuGet all CSS and images throw a 500 error. I verified that the specific package is the Asp.Net package, I installed one at a time until the error was thrown.

The specific error is:

HTTP Error 500.19 - Internal Server Error
Cannot add duplicate collection entry of type 'add' /
with unique key attribute 'name' set to 'Glimpse

The line causing the error is below, specifically the <add> element.

<handlers>
    <add name="Glimpse" path="glimpse.axd" verb="GET" type="Glimpse.AspNet.HttpHandler, Glimpse.AspNet" preCondition="integratedMode" />
</handlers>

How can I fix this problem so I can properly use Glimpse? I'm on Visual Studio 2015, IIS Express 10, .NET 4.6.


Solution

  • Couple things to check:

    Since this line is in a web.config, have you checked all web.configs for this value? Could be that multiple got put in spread across your project.

    Second, you could try doing a remove

    <remove name="Glimpse">
    

    before the add statement and see if that clears it up. Could be that Glimpse is added somewhere else on the system.