将dotless添加到我的本地网站后,HTTP错误500.23

Hel*_*rld 27 .net asp.net web-config 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>
Run Code Online (Sandbox Code Playgroud)

这是我得到的错误

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.
Run Code Online (Sandbox Code Playgroud)

你能帮忙吗?

Hel*_*rld 28

添加 <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>
Run Code Online (Sandbox Code Playgroud)


nph*_*phx 12

<validation validateIntegratedModeConfiguration="false"/> 告诉IIS忽略配置问题.一个这样的问题似乎是无点自动添加处理程序system.websystem.webServer.前一部分由经典应用程序池模式使用,而后者由新的集成应用程序池模式使用.由于我使用的是集成模式,因此删除system.web中的处理程序也是有帮助的.

  • 谢谢!.我刚刚从system.web部分删除了httpHandler部分,一切正常. (2认同)