.net app.config bindingRedirect是否危险?

.net app.config bindingRedirect是否危险?,.net,conflict,.net,Conflict,我总是在不同的项目中看到绑定重定向!例如,在创建新的MVC5项目时 <dependentAssembly> <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" /> <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" /> </dependentA

我总是在不同的项目中看到绑定重定向!例如,在创建新的MVC5项目时

  <dependentAssembly>
    <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
  </dependentAssembly>

人们用它来解决各种版本冲突,却没有考虑太多

  • 这不是很危险,会导致运行时错误吗
  • 当API可能已更改时,Microsoft为什么要在两个版本之间创建重定向
  • 编译器是否可以检查API是否没有更改

而且,即使API没有改变,逻辑也可能会改变。

这是一个非常好的问题。我不知道人们为什么要绑定重定向,并假设在库版本之间切换不会有问题。可惜没人接。