asp.net - 将 dotless 添加到我的本地网站后出现 HTTP 错误 500.23

标签 asp.net .net web-config dotless

嗨,我正在尝试运行 dotless在我本地的 .net4 网站上

我的网络配置如下所示:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="dotless" type="dotless.Core.configuration.DotlessConfigurationSectionHandler, dotless.Core" />
  </configSections>
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  <httpHandlers><add path="*.less" verb="GET" type="dotless.Core.LessCssHttpHandler, dotless.Core" /></httpHandlers></system.web>
<dotless minifyCss="false" cache="true" web="false" />

    <system.webServer>
        <handlers>
            <add name="dotless" path="*.less" verb="GET" type="dotless.Core.LessCssHttpHandler,dotless.Core" resourceType="File" preCondition="" />
        </handlers>
    </system.webServer>
</configuration>

这是我收到的错误

HTTP Error 500.23 - Internal Server Error
An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.
Most likely causes:

    This application defines configuration in the system.web/httpHandlers section.

你能帮忙吗?

最佳答案

添加<validation validateIntegratedModeConfiguration="false"/>工作过

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="dotless" type="dotless.Core.configuration.DotlessConfigurationSectionHandler, dotless.Core" />
  </configSections>
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  <httpHandlers>
      <add path="*.less" verb="GET" type="dotless.Core.LessCssHttpHandler, dotless.Core" />
  </httpHandlers>
  </system.web>
<dotless minifyCss="false" cache="true" web="false" />

    <system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>
        <handlers>
            <add name="dotless" path="*.less" verb="GET" type="dotless.Core.LessCssHttpHandler,dotless.Core" resourceType="File" preCondition="" />
        </handlers>
    </system.webServer>
</configuration>

关于asp.net - 将 dotless 添加到我的本地网站后出现 HTTP 错误 500.23,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17807062/

相关文章:

c# - JavaScript 客户端函数未针对 ASP 自定义验证器触发

c# - 在 C# 中将 while 循环与 Task.Run() 相结合

c# - 访问共享文件?

asp.net - 在 Web.config 中配置 ASP.NET 路由

.net - 我的 ConfigurationSection 的 xsd 模式

msbuild - web.config转换在构建服务器上不起作用

c# - 无法成功从数据库中删除记录

asp.net - Gridview 中的条件删除按钮

c# - 参数化 sql 查询 - asp.net/c#

c# - 未抛出 OptimisticConcurrencyException : Possible reason: UpdateCommand