安装dotless时Web配置错误

时间:2016-01-09 14:00:15

标签: asp.net dotless

我有一个非常基本的空asp.net应用程序,并将nuget包添加到项目中。

一旦我这样做,我就会收到服务器错误

The requested page cannot be accessed because the related configuration data for the page is invalid.

根据我的理解,这可能是由于在Web配置文件中读取信息时出现问题。

<configuration>
 <system.web>
<compilation debug="true" targetFramework="4.5"/>
<httpRuntime targetFramework="4.5"/>
<httpHandlers>
  <add path="*.less" verb="GET" type="dotless.Core.LessCssHttpHandler, dotless.Core"/>
</httpHandlers>
</system.web>
<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>
<configSections>
<section name="dotless" type="dotless.Core.configuration.DotlessConfigurationSectionHandler, dotless.Core"/>
</configSections>
<dotless minifyCss="false" cache="true" web="false" strictMath="false"/>
</configuration>

它发生在阅读configSections

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

发现问题。 configSections需要坐在configuration