dotnet/roslyn

CS1705 must indicate which library with the conflict

Open

#66.161 aperta il 30 dic 2022

Vedi su GitHub
 (1 commento) (0 reazioni) (0 assegnatari)C# (4257 fork)batch import
Area-CompilersConcept-Diagnostic Clarityhelp wanted

Metriche repository

Star
 (20.414 star)
Metriche merge PR
 (Merge medio 6g 17h) (256 PR mergiate in 30 g)

Descrizione

Version Used:

Problem:

CS1705 errors like are not very helpfull:

Assembly 'AssemblyName1' uses 'TypeName' which has a higher version than referenced assembly 'AssemblyName2'

When one of the assemblies is not directly referenced by the my code. E.g. using two public libraries where each of them uses a different version of the same library. I as the developer must traverse the chain of assembly references for all referenced assemblies

Expected Behavior:

Assembly 'AssemblyName1' with identity 'AssemblyName1 Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'Microsoft.Extensions.Configuration.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' which has a higher version than referenced assembly 'Microsoft.Extensions.Configuration.Abstractions' with identity 'Microsoft.Extensions.Configuration.Abstractions, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' used by 'AssemblyName2' which is used by 'AssemblyName3' (all the way to the highest level assembly/NuGet package)

Actual Behavior:

Assembly 'AssemblyName1' with identity 'AssemblyName1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'Microsoft.Extensions.Configuration.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' which has a higher version than referenced assembly 'Microsoft.Extensions.Configuration.Abstractions' with identity 'Microsoft.Extensions.Configuration.Abstractions, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'

Guida contributor