How to use Glimpse in Orchard CMS

筅森魡賤 提交于 2019-12-01 02:09:25

问题


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!


回答1:


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>


来源:https://stackoverflow.com/questions/9179655/how-to-use-glimpse-in-orchard-cms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!