質問

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!

役に立ちましたか?

解決

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>
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top