Master list of all NuGet Version to .NET Framework to AssemblyVersionAttribute mappings?

1

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:

  1. Run 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 Studio
  2. Load 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

  3. 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):

  1. System.IO.FileLoadException: Could not load file or assembly 'System.ComponentModel.Annotations, Version=4.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
  2. System.IO.FileLoadException: Could not load file or assembly 'System.ComponentModel.Annotations, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
  3. 'Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.'
  4. Could not load type 'System.Runtime.CompilerServices.IAsyncStateMachine' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
c#
.net
.net-core
nuget
.net-standard
asked on Stack Overflow Aug 20, 2018 by John Zabroski • edited Aug 20, 2018 by John Zabroski

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0