Search code examples
asp.net-web-api2glimpse

Runtime policy does not allow execution of resource named 'glimpse_config'


I tried add glipse to the webapi project, but I always get error "Runtime policy does not allow execution of resource named 'glimpse_config'."

How can I fix it ? How disable this policy ?


Solution

  • In the web.config file inside your web application project, ensure that the following setting is added somewhere under the 'configuration' XML element, i.e.

    <configuration>
    ....other config
    
    <glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd"></glimpse>
    
    </configuration>
    

    This also requires the following namespace reference if you don't have it already which should be placed within the 'configSections' element:

    <configuration>
      <configSections>
          ... other config
          <section name="glimpse" type="Glimpse.Core.Configuration.Section, Glimpse.Core" />
      </configSections>
    </configuration>