dotnet/roslyn

CS1705 must indicate which library with the conflict

Open

#66,161 opened on Dec 30, 2022

View on GitHub
 (1 comment) (0 reactions) (0 assignees)C# (4,257 forks)batch import
Area-CompilersConcept-Diagnostic Clarityhelp wanted

Repository metrics

Stars
 (20,414 stars)
PR merge metrics
 (Avg merge 6d 17h) (256 merged PRs in 30d)

Description

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'

Contributor guide