How to use Glimpse in Orchard CMS
Asked Answered
C

1

6

I'm new to Orchard CMS. I want to use Glimpse in Orchard cms and config it as quick start, but when I go to http://localhost:30320/OrchardLocal/glimpse.axd it show error message "The resource cannot be found"

Anyone know how to resolve it, please show me. Thanks!

Calvo answered 7/2, 2012 at 16:10 Comment(0)
D
12

You need to modify the web.config in the Orchard.Web folder. If you installed Glimpse using NuGet, it added two settings to the web.config to tell the web server to use Glimpse to handle the glimpse.axd resource.

The problem is the Orchard.Web\web.config file's <httpHandlers> and <handlers> sections both include a catch all handler to block all resources by default, and the Glimpse settings get added after the catch alls. You just need to move the glimpse entries to appear before the catch alls.

In <httpHandlers> section, change from this:

<httpHandlers>
...
  <add path="*" verb="*" type="System.Web.HttpNotFoundHandler" />
  <add path="glimpse.axd" verb="GET,POST" type="Glimpse.Core.Handler" />
</httpHandlers>

to this:

<httpHandlers>
  ...
  <add path="glimpse.axd" verb="GET,POST" type="Glimpse.Core.Handler" />
  <add path="*" verb="*" type="System.Web.HttpNotFoundHandler" />
</httpHandlers>

Next, in <handlers> section, change from this:

<handlers accessPolicy="Script,Read">
  ...
  <add name="NotFound" path="*" verb="*" type="System.Web.HttpNotFoundHandler" preCondition="integratedMode" requireAccess="Script" />
  <add name="Glimpse" path="glimpse.axd" verb="GET,POST" type="Glimpse.Core.Handler,Glimpse.Core" preCondition="integratedMode" />
</handlers>

To this:

<handlers accessPolicy="Script,Read">
  ...
  <add name="Glimpse" path="glimpse.axd" verb="GET,POST" type="Glimpse.Core.Handler,Glimpse.Core" preCondition="integratedMode" />
  <add name="NotFound" path="*" verb="*" type="System.Web.HttpNotFoundHandler" preCondition="integratedMode" requireAccess="Script" />
</handlers>
Dyche answered 7/2, 2012 at 19:7 Comment(1)
You might want to check out the Orchard specific mini profiler. It probably gives more profiling info specific to Orchard. orchardprofiler.codeplex.comDyche

© 2022 - 2024 — McMap. All rights reserved.