Nuget Update-Package错误地更新了程序集绑定重定向 [英] Nuget Update-Package incorrectly updating assembly binding redirects

查看:343
本文介绍了Nuget Update-Package错误地更新了程序集绑定重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个内部NuGet程序包,其中包含一个dll,没有外部NuGet程序包依赖性以及没有web.config转换.

I have an internal NuGet package that contains a single dll, no external NuGet package dependencies, and no web.config transforms.

但是,当我在针对该特定NuGet的项目(类lib和网站)上运行Update-Package时,它会自动将我的网站web.config程序集绑定重定向到System.Web的较旧版本Mvc和Newtonsoft.Json.网站web.config当前已将它们绑定到所使用的最新版本.

Yet when i run Update-Package on my projects (class lib and website) for this specific NuGet, it automatically is updating my website web.config assembly binding redirects to older versions of System.Web.Mvc and Newtonsoft.Json. The website web.config currently has them bound to the latest version being used.

使用GUI,利用Manage NuGet程序包解决方案...我选择为引用了旧版本的适用项目更新此NuGet.然后选择更新

Using the GUI, utilizing Manage NuGet packages for Solution... I choose to UPDATE this NuGet for applicable projects that have a reference to the old version. Then choose Update

以下是软件包管理器的输出: http://pastebin.com/3ySwTRFR

Here is the output from Package Manager: http://pastebin.com/3ySwTRFR

我的web.config来自:

And my web.config went from:

  <dependentAssembly>
    <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="0.0.0.0-5.1.0.0" newVersion="5.1.0.0" />
  </dependentAssembly>

  <dependentAssembly>
    <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
  </dependentAssembly>

收件人:

  <dependentAssembly>
    <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="0.0.0.0-4.0.0.1" newVersion="4.0.0.1" />
  </dependentAssembly>

  <dependentAssembly>
    <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="4.5.0.0" />
  </dependentAssembly>

我正在更新的NuGet程序包具有一个引用Newtonsoft.Json的dll(但未明确地使其成为NuGet程序包的依赖项)

The NuGet package I am updating has a dll which references Newtonsoft.Json (but is not explicitly made a NuGet package dependency)

在不知道开发人员更新此NuGet软件包时,它会中断运行时以查找旧版本的MVC或JSON.NET dll.

When unknowing developer updates this NuGet package it breaks the runtime looking for old version of MVC or JSON.NET dlls.

过去,我曾尝试使用- IgnoreDependencies powershell命令开关,但这似乎对该问题没有影响.

In the past I have attempted to use the -IgnoreDependencies powershell command switch, but this appears to have no impact on the issue.

关于在更新包期间如何转换我的web.config(无显式转换)的任何想法?

Any idea on what could be transforming my web.configs (without an explicit transform) during update-package?

带有NuGet 3.3.0的VS2015似乎表现更好……在随机软件包更新期间,它发现了一个旧的BAD绑定重定向并对其进行了更正!

VS2015 w/ NuGet 3.3.0 seems to be behaving better... during random package update it found an old BAD binding redirect and corrected it!

推荐答案

在NuGet 3.3.0中,现在可以跳过应用绑定重定向的操作:

Skip applying binding redirects is an option now in NuGet 3.3.0: Issue #1147

这篇关于Nuget Update-Package错误地更新了程序集绑定重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆