gpt4 book ai didi

c# - 我可以告诉 bindingRedirect 始终使用最新的可用版本吗?

转载 作者:可可西里 更新时间:2023-11-01 03:01:58 26 4
gpt4 key购买 nike

对于 ASP.NET 应用程序,Web.Config 文件中有几个条目,格式如下:

<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-1.6.5135" newVersion="1.6.5135" />
</dependentAssembly>

这些库以 NuGet 包的形式出现。

现在每次更新我的 20 多个 NuGet 包时,我都会执行以下操作:

  1. 一键更新所有包。
  2. 在浏览器中打开应用程序。
  3. 查看类似 this one 的错误.
  4. 打开我的 Web.Config,找到绑定(bind)重定向条目。
  5. 查找程序集的最新版本。
  6. 修改我的 web.config。
  7. 更新所有其他具有绑定(bind)重定向的已更新 NuGet 包的步骤 2…6。

非常烦人。

我的问题:

有没有办法告诉 bindingRedirect entry始终使用最新版本?

例如像这样的东西:

<bindingRedirect oldVersion="0.0.0.0-*" newVersion="*" />

(使用通配符来告诉最新版本)

我最接近的是这样的:

<bindingRedirect oldVersion="0.0.0.0-9.9.9.9" newVersion="1.6.5135" />

(只指定一次最新版本)

最佳答案

不幸的是,答案是否定的。查看bindingRedirect element on MSDN .

引用:

oldVersion: Required attribute.

Specifies the version of the assembly that was originally requested. The format of an assembly version number is major.minor.build.revision. Valid values for each part of this version number are 0 to 65535.

You can also specify a range of versions in the following format: n.n.n.n - n.n.n.n

newVersion: Required attribute. Specifies the version of the assembly to use instead of the originally requested version in the format: n.n.n.n

This value can specify an earlier version than oldVersion.

关于c# - 我可以告诉 bindingRedirect 始终使用最新的可用版本吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24497259/

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