When the same assembly is found in two separate ways, the AssemblyName differs?

huzaifa sunny 1 Reputation point

When the same assembly is found in two separate ways, the AssemblyName differs.
I've been investigating assembly versions to tackle assembly binding redirect difficulties in a.NET 4.7.2 app. I've been through hundreds of assemblies by this point, but one, in particular, has been very upsetting. Depending on how I retrieve the AssemblyName, the assembly System.ValueTuple.dll returns a different AssemblyName (particularly the Version changes). The two following methods yield identical AssemblyName objects for the other hundreds of assemblies. The first returns a Version of while the second returns a value of for System.ValueTuple.dll.


var assemblyName2 = AssemblyName.GetAssemblyName(filePath); / Method 2

AssemblyName1 and assemblyName2 are both of the same Type, have the same Name, and have the same public key, but their versions differ. This is the first time I've ever seen anything like it.

Does anyone have any idea what's going on here?

A set of technologies in the .NET Framework for building web applications and XML web services.
3,306 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 57,731 Reputation points

    nuget packages for 4.7:

    System.ValueTuple: 4.0.3 = dll
    System.ValueTuple: 4.0.4 = dll
    System.ValueTuple: 4.5.0 = dll

    your projects probably use different nuget package versions. as 4.5.0 is the last nuget version (and 4 years old) and not used after core 2.0 (which is unsupported) you should just update the nuget references.

    0 comments No comments