gpt4 book ai didi

c# - 无法加载文件或程序集 WebMarkupMin.Core

转载 作者:行者123 更新时间:2023-11-30 20:34:31 25 4
gpt4 key购买 nike

我已经安装了

WebMarkupMin.MVC

在我的 visual studio 2013 MVC 项目中使用 nuget。

现在这个安装没有任何错误,但是当我运行解决方案时,我收到以下错误;

Could not load file or assembly 'WebMarkupMin.Core, Version=1.1.0.0, Culture=neutral, PublicKeyToken=99472178d266584b' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

现在检查解决方案中 dll 的引用(即右键单击属性)显示版本 1.0.0.0,运行时版本 v4.0.30319。

我的 web.config 有以下内容;

  <dependentAssembly>
<assemblyIdentity name="WebMarkupMin.Core" publicKeyToken="99472178d266584b" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.0.0.0" newVersion="1.0.0.0" />
</dependentAssembly>

我的 packages.config 具有以下内容;

  <package id="WebMarkupMin.Core" version="1.0.0" targetFramework="net451" />
<package id="WebMarkupMin.Mvc" version="1.1.0" targetFramework="net451" />
<package id="WebMarkupMin.Web" version="1.0.0" targetFramework="net451" />

我已经清理了解决方案并删除了 bin 文件夹中的所有文件,重建并重新运行项目,但仍然出现相同的错误?

为了完整起见,我然后在我的 MVC Controller 中使用 WebMarkupMin,如下所示;

using WebMarkupMin.Mvc.ActionFilters;
namespace MyProject.Controllers
{
public class HomeController : Controller
{

[MinifyHtml]
[OutputCache(Duration = 4956, VaryByParam = "none")]
public ActionResult Index()
{
return View();
}

这里有什么我遗漏的吗,为什么它引用 1.1.0 版本有什么想法吗?

最佳答案

我设法通过 Nuget 将 .Core 版本指定为 1.1.0.0 来解决这个问题

install-package WebMarkupMin.Core -version 1.1.0.0

我不确定这是否特定于我的问题,但希望它能帮助其他人。

关于c# - 无法加载文件或程序集 WebMarkupMin.Core,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39140354/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com