migrate.exe ignoring binding redirects

浪尽此生 提交于 2020-01-22 20:06:09

问题


I am trying to run the migrate.exe application from EntityFramework on a specific DLL. This DLL references the Microsoft.Azure.KeyVault.WebKey nuget package.

When I try to run the command

./migrate MyProject.Data /startUpDirectory=C:\myDir /startUpConfigurationFile=C:\myDir\Redirect.config

I get the following error

ERROR: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6ae ed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Excep tion from HRESULT: 0x80131040)

Normally I would say that this is because it is looking for version 6 of Newtonsoft.Json and cannot find it. But I have a binding redirect that points to the latest version.

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
  </dependentAssembly>
</assemblyBinding>

So, I dont understand why this would not redirect to version 9.0.0.0 and it only looks for version 6.0.0.0.

I have decompiled the Microsoft.Azure.KeyVault.WebKey.dll and I can see that it is referencing version 6.0.0.0 so that is WHY its looking for that version but I cant see why it isn't redirecting.

来源:https://stackoverflow.com/questions/43679656/migrate-exe-ignoring-binding-redirects

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!