简体   繁体   English

安全异常运行无点

[英]Security Exception running dotless

I'm getting a Security Exception when I attempt to access a .less file in IIS7. 尝试访问IIS7中的.less文件时出现安全异常。

The exception text is: 异常文本为:

Security Exception 安全例外

The application attempted to perform an operation not allowed by the security policy. 应用程序尝试执行安全策略不允许的操作。 To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. 要授予此应用程序所需的权限,请联系系统管理员或在配置文件中更改应用程序的信任级别。

I've added the following to my web.config file: 我已将以下内容添加到我的web.config文件中:

<configSections>
  <section name="dotless" type="dotless.Core.configuration.DotlessConfigurationSectionHandler,dotless.Core" requirePermission="false" />
</configSections>

<httpHandlers>
  <remove verb="*" path="*.asmx" />
  <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
  <add type="dotless.Core.LessCssHttpHandler,dotless.Core" path="*.LESS" verb="*" validate="false" />
</httpHandlers>

<dotless minifyCss="false" cache="false" />  

<system.webServer>
  <handlers>
    <add name="dotLess" path="*.less" verb="*" type="dotless.Core.LessCssHttpHandler" resourceType="Unspecified" preCondition="integratedMode" />
  </handlers>
</system.webServer>

Any ideas? 有任何想法吗?

I'm running a MVC2 .Net application. 我正在运行MVC2 .Net应用程序。

have you added the MIME type to IIS? 您是否已将MIME类型添加到IIS? if no add extension .less MIME type 'text/css' 如果没有,则添加扩展名.less MIME类型'text / css'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM