尝试访问.less-file时,无法从程序集'dotless.Core'加载'dotless.Core.LessCssHttpHandler'类型

时间:2013-02-13 09:32:51

标签: asp.net iis iis-6 dotless

当我尝试访问.less文件时,我在IIS6站点中收到以下错误:

Detailed error information (authorized by permissions to functions)
Error occured   13.02.2013 10:30:19
User IP 93.89.112.52
User Agent  Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0
Url http://www.oppdal.kommune.no/Templates/SSP.MasterPages/Static/css/style.less
Referer (none)
Exception details:
ConfigurationErrorsException: Could not load type 'dotless.Core.LessCssHttpHandler ' from assembly 'dotless.Core'. (C:\prokom\Oppdal Kommune CMS6R2Newest2\web.config line 377)
Stack trace:

[ConfigurationErrorsException: Could not load type 'dotless.Core.LessCssHttpHandler
    ' from assembly 'dotless.Core'. (C:\prokom\Oppdal Kommune CMS6R2Newest2\web.config line 377)]
   at System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase)
   at System.Web.Configuration.HttpHandlerAction.Create()
   at System.Web.Configuration.HandlerFactoryCache..ctor(HttpHandlerAction mapping)
   at System.Web.HttpApplication.GetFactory(HttpHandlerAction mapping)
   at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
   at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

[Inner exception TypeLoadException: Could not load type 'dotless.Core.LessCssHttpHandler
    ' from assembly 'dotless.Core'.]
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName)
   at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
   at System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
   at System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
   at System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase)

httpHandlers-section中的Web.config:

<add type="
    dotless.Core.LessCssHttpHandler
    ,dotless.Core" validate="false"
    path="*.LESS" verb="*" />

dotless。版本1.3.1.0的核心位于bin文件夹中。

这是什么原因以及如何解决?

2 个答案:

答案 0 :(得分:0)

我把我放在了错误的httpHandlers部分。它位于system.web部分而不是system.webServer。

我也发现了这个: Unable to get dotLess to work

它对我不起作用,但它给了我一个暗示,我把它放在了错误的地方。

答案 1 :(得分:0)

在最后一个版本上是不同的:

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