首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >错误无法从程序集的'dotless.Core.configuration.WebConfigConfigurationLoader‘、dotless.Core、Version=1.5.3.0加载类型

错误无法从程序集的'dotless.Core.configuration.WebConfigConfigurationLoader‘、dotless.Core、Version=1.5.3.0加载类型
EN

Stack Overflow用户
提问于 2018-05-07 07:25:34
回答 1查看 1.2K关注 0票数 3

我正在使用asp.net MVC应用程序(.net Framework4.6.1),我希望为.less文件使用捆绑包,因此我在BundleConfig文件中注册了这些包,如下所示

代码语言:javascript
复制
public static void RegisterBundles(BundleCollection bundles)
{
   //other bundles are here ..
    bundles.Add(new LessBundle("~/Content/less").Include("~/Content/*.less"));
}

为了使用less,我已经从包管理器安装了以下软件包

代码语言:javascript
复制
dotless.Core.1.6.0.1
dotless.AspNetHandler.1.6.0.1
System.Web.Optimization.Less.1.3.4

这是我的_Layout.cshtml

代码语言:javascript
复制
<!DOCTYPE html>
<html style=" height: 100%;
  margin: 0;">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>@ViewBag.Title - My ASP.NET Application</title>
    @Styles.Render("~/Content/css")
    @Styles.Render("~/Content/less")
    @Scripts.Render("~/bundles/modernizr")
</head>
<body style="padding:0;margin:0;" class="col-12 h-100">
    <div class="h-100 border">
        @RenderBody()
    </div>
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/jqueryval")
    @Scripts.Render("~/bundles/bootstrap")
    @RenderSection("scripts", required: false)
</body>
</html>

现在,当我运行应用程序时,在@Styles.Render("~/Content/less")上得到以下错误

'dotless.Core.configuration.WebConfigConfigurationLoader‘System.TypeLoadException:“无法从程序集加载类型dotless.Core、Version=1.5.3.0、Culture=neutral、PublicKeyToken=96b446c9e63eae34”。

我搜索了这个错误,并得到了无网点:如果你使用System.Web.Optimization.Less,就不要升级你的清白链接谁已经遇到了这个问题,但我仍然收到同样的错误,甚至遵循他们的建议。

如果有人已经面临这个问题,请帮忙。

EN

回答 1

Stack Overflow用户

发布于 2018-10-17 09:03:27

似乎System.Web.Optimization.Less仍然期望WebConfigConfigurationLoaderdotless.Core程序集中,而无标记1.6 (它已被移到新的dotless.AspNet程序集中)并不是这样。

我又回到了(无标记的1.5.2 ),现在一切都很好。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50209049

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档