7

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.

David Pilkington
  • 13,528
  • 3
  • 41
  • 73
  • I have also faced the same problem.did you resolved the error. if you resolved the error can you please post your answer. – Pradeep Jun 14 '17 at 09:31
  • This answer to a similar question might be useful to you (particularly if your assembly is .net 4.0): https://stackoverflow.com/questions/11794084/getting-migrate-exe-to-work#12270108 – Mr Grok Aug 23 '17 at 11:22

0 Answers0