Uwe*_*eim 19 .net c# asp.net asp.net-mvc assembly-binding-redirect
拥有一个ASP.NET应用程序,Web.Config文件中有以下格式的几个条目:
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-1.6.5135" newVersion="1.6.5135" />
</dependentAssembly>
Run Code Online (Sandbox Code Playgroud)
这些库以NuGet包的形式出现.
现在,每当我更新我的20多个NuGet包时,我会做类似的事情:
这非常烦人.
我的问题:
有没有办法告诉bindingRedirect条目总是使用最新版本?
例如:
<bindingRedirect oldVersion="0.0.0.0-*" newVersion="*" />
Run Code Online (Sandbox Code Playgroud)
(使用通配符告诉最新版本)
我最接近的是:
<bindingRedirect oldVersion="0.0.0.0-9.9.9.9" newVersion="1.6.5135" />
Run Code Online (Sandbox Code Playgroud)
(仅指定最新版本一次)
不幸的是,答案是否定的.请参阅MSDN上的bindingRedirect元素.
报价:
oldVersion:必需属性.
指定最初请求的程序集的版本.程序集版本号的格式为major.minor.build.revision.此版本号的每个部分的有效值为0到65535.
您还可以使用以下格式指定一系列版本: nnnn - nnnn
newVersion:必需属性.指定要使用的程序集的版本,而不是最初请求的版本,格式为:nnnn
此值可以指定早于oldVersion的版本.
| 归档时间: |
|
| 查看次数: |
6111 次 |
| 最近记录: |