HTTP Error 500.23 after adding dotless to my local website
Asked Answered
A

4

27

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

My web config looks like this:

<?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>

Here is the error I get

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.

Can you please help?

Antisepticize answered 23/7, 2013 at 10:2 Comment(0)
A
29

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>
Antisepticize answered 23/7, 2013 at 12:12 Comment(1)
This fixed my issue for an ancient project that I needed to run! Thanks +1.Symonds
D
13

<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.

Dupre answered 28/7, 2015 at 13:50 Comment(2)
Thanks!. I just deleted the httpHandler section from system.web section and everything ok.Sounding
This should be the answer as it actually addresses the root problem rather than putting a bandaid over it.Subclavian
S
0

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" />

Senate answered 20/8, 2015 at 20:3 Comment(0)
P
-1

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>
Perrins answered 30/5, 2018 at 7:9 Comment(1)
This is a duplicate of prior answerRibbonfish

© 2022 - 2024 — McMap. All rights reserved.