HTTP Error 500.23 after adding dotless to my local website

前端 未结 4 1776
陌清茗
陌清茗 2021-02-03 22:28

Hi I\'m trying to run dotless on my local .net4 web site

My web config looks like this:

         


        
相关标签:
4条回答
  • 2021-02-03 23:09

    I had to add <validation validateIntegratedModeConfiguration="false"/> to my webserver section and I also had to move the configSections to be the first element in my Configuration.

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

    0 讨论(0)
  • 2021-02-03 23:13

    We will add a small piece of code into web.config file. open web.config from your IIS root or change the setting in Visual Studio web.config and publish again.

      <system.webServer>
                <validation validateIntegratedModeConfiguration="false"/>
              </system.webServer>
    
    0 讨论(0)
  • 2021-02-03 23:19

    <validation validateIntegratedModeConfiguration="false"/> tells IIS to ignore configuration issues. One such issue seems to be the fact that dotless automatically adds a handler to system.web and system.webServer. The former section is used by the classic application pool mode, whereas the latter by the new integrated application pool mode. Since I am using the integrated mode, removing the handler in system.web helped just as well.

    0 讨论(0)
  • 2021-02-03 23:22

    adding <validation validateIntegratedModeConfiguration="false"/> worked

    <?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>
    
    0 讨论(0)
提交回复
热议问题