question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not upgrade projects to new 2.2.100 sdk getting conflict warnings

See original GitHub issue

Could not upgrade all projects to new 2.2.100 sdk, as we got conflict warnings for among others

1:7>/usr/local/share/dotnet/sdk/2.2.100/Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3277: Found conflicts between different versions of "Microsoft.AspNetCore.Authentication.Abstractions" that couldnot be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed. [/projpath]
  • Microsoft.Extensions.Options
  • Microsoft.Extensions.DependencyInjection.Abstractions
  • Microsoft.AspNetCore.Http.Abstractions
  • Microsoft.Extensions.Configuration.Abstractions
  • Microsoft.AspNetCore.Hosting
  • Microsoft.AspNetCore.Hosting.Abstractions
  • Microsoft.EntityFrameworkCore
  • Microsoft.AspNetCore.WebUtilities
  • Microsoft.AspNetCore.Authentication.Abstractions

What all of these packages have in common is that they list a 2.2.0 release on nuget.org https://www.nuget.org/packages/Microsoft.Extensions.Options/2.2.0 and if you look carefully they are all at Downloads: 0.

Which is why msbuild detailed logs gives errors like these

         Dependency "Microsoft.Extensions.Options, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60".
             Could not resolve this reference. Could not locate the assembly "Microsoft.Extensions.Options, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
[...]
There was a conflict between "Microsoft.Extensions.Options, Version=2.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" and "Microsoft.Extensions.Options, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60".
             "Microsoft.Extensions.Options, Version=2.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" was chosen because it was primary and "Microsoft.Extensions.Options, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" was not.
             References which depend on "Microsoft.Extensions.Options, Version=2.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" [/Users/nfloris/.nuget/packages/microsoft.extensions.options/2.1.0/lib/netstandard2.0/Microsoft.Extensions.Options.dll].
                 /Users/nfloris/.nuget/packages/microsoft.extensions.options/2.1.0/lib/netstandard2.0/Microsoft.Extensions.Options.dll
                   Project file item includes which caused reference "/Users/nfloris/.nuget/packages/microsoft.extensions.options/2.1.0/lib/netstandard2.0/Microsoft.Extensions.Options.dll".
                     /Users/nfloris/.nuget/packages/microsoft.extensions.options/2.1.0/lib/netstandard2.0/Microsoft.Extensions.Options.dll
             References which depend on "Microsoft.Extensions.Options, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" [].
                 myproj/bin/Debug/netcoreapp2.2/myproj.dll
                   Project file item includes which caused reference "myproj/bin/Debug/netcoreapp2.2/myproj.dll".
                     myproj/bin/Debug/netcoreapp2.2/myproj.dll

Could not resolve this reference. Could not locate the assembly “Microsoft.Extensions.Options, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60”.

Now that seems like a problem

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:2
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
natemcmastercommented, Dec 6, 2018

I think the problem more-or-less boils down to this: https://github.com/dotnet/sdk/issues/2420. Microsoft.AspNetCore.App does not yet flow transitively across ProjectReference. You have to have a reference to this in every project which uses it (directly or transitively). It’s something we hope to address in 3.0.

0reactions
natemcmastercommented, Dec 6, 2018

But why weren’t those warnings present while we had the same proj content during 2.1?

That’s a great question. I don’t know why.

You’re saying that even in those common cases such a workaround is the only option?

Yes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to resolve .NET Core package version conflicts
NET Core 2.2 Web API project along with five .NET Standard 2.0 projects all housed under one solution. I am now receiving 28...
Read more >
Migrate from ASP.NET Core 2.1 to 2.2
This article outlines the prerequisites and most common steps for migrating an ASP.NET Core 2.1 project to ASP.NET Core 2.2.
Read more >
NETSDK1045: The current .NET SDK does not support ...
This error occurs when the build tools can't find the version of the .NET SDK that's needed to build a project. This is...
Read more >
The Current .NET SDK does not support targeting . ...
How to work around a common .NET Core compilation targeting error using .NET Core 3 SDK and .NET Core 3 projects with Visual...
Read more >
Visual Studio 2019 unable to locate .Net Core SDK
Step 1) First run dotnet --list-sdks from the command line (as in Grzegorz Smulko's answer). Take note of the greatest version number.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found