Is there a master list somewhere of all the odd NuGet version to Assembly version mappings? This is VERY confusing trying to upgrade old applications and debugging FileLoadException
errors that ocur when Assembly Fusion runs. I have found a master matrix of all .NET Standard versions to .NET implementation versions, but nothing at the package-level.
Background for those unfamiliar:
Install-Package System.ComponentModel.Annotations -Version 4.5.0
or add this package to an empty .NET Standard or .NET Core project template in Visual StudioLoad your target framework's DLL and then grab the FullName:
$path = "C:\source\Infrastructure\SqlClone\Source\Company.Database.SqlCloneTask\packages\System.ComponentModel.Annotations.4.5.0\lib\net461\System.ComponentModel.Annotations.dll"
$assembly = [Reflection.Assembly]::ReflectionOnlyLoadFrom($path)
$assembly.FullName
This returns:
System.ComponentModel.Annotations, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Then using the Version=4.2.10 and PublicKeyTooken=b03f5f7f11d50a3a to generate an runtime.assemblyBinding.dependentAssembly.bindingRedirect:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.ComponentModel.Annotations" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="4.2.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
The above steps are the only way I have found to reliably fix FileLoadException
errors with bindingRedirect
configurations, without using Google Search and finding a StackOverflow answer or GitHub issue :). Even right clicking Properties on the file and going to the Details tab shows:
Example errors (should help Google Search results):
User contributions licensed under CC BY-SA 3.0