Conflicts with Nuget Package References

Viewed 53

I have observed a strange behaviour of NuGet packages where the same version of NuGet packages (under different projects of a solution) refers different versions of dependent dlls. Please see the images below: Microsoft.Extensions.Caching.Abstractions Version 3.1.3 Same assembly , different version Same assembly , different version

This is my nuget folder for Microsoft.Extensions.Caching.Abstractions: Nuget folder for Microsoft.Extensions.Caching.Abstractions

But the logs shows that version 3.1.18 has been loaded, which is never used in any of the package references used in the solution. Am I missing something here?

`AppDomain: AssemblyLoad: Microsoft.Extensions.Caching.Abstractions, Version=3.1.18.0, 
Culture=neutral, PublicKeyToken=adb9793829ddae60`

I have tried changing the Verbosity (Tools--> Options--> Projects and Solutions--> Build and Run) to "Diagnostics" and the build output showed the following conflict:

`Encountered conflict between 'Platform:Microsoft.Extensions.Caching.Abstractions.dll' and 'CopyLocal:C:\Users\91998\.nuget\packages\microsoft.extensions.caching.abstractions\3.1.3\lib\netcoreapp3.1\Microsoft.Extensions.Caching.Abstractions.dll'. Choosing 'CopyLocal:C:\Users\91998\.nuget\packages\microsoft.extensions.caching.abstractions\3.1.3\lib\netcoreapp3.1\Microsoft.Extensions.Caching.Abstractions.dll' because AssemblyVersion '3.1.3.0' is greater than '3.1.0.0'`

Please guide how to correct this so that there won’t be any conflicts between versions of the same assembly within the solution and the same assembly reference will be used in all the projects.

0 Answers
Related