Skip to content

Could not upgrade projects to new 2.2.100 sdk getting conflict warnings #2721

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
NinoFloris opened this issue Dec 5, 2018 · 8 comments
Closed
Labels
Milestone

Comments

@NinoFloris
Copy link

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

@livarcocc
Copy link
Contributor

What does your csproj look like?

cc @dsplaisted @natemcmaster

@livarcocc livarcocc added this to the Discussion milestone Dec 5, 2018
@dsplaisted
Copy link
Member

If you can provide a binary log, that would help us investigate. Please read the link though, a binary log includes a lot of detailed information so be sure that you are comfortable sharing it.

@NinoFloris
Copy link
Author

I have a repro with binary log in the root (/bl /verbosity:diag) readme gives some extra context, hopefully this is helpful.

https://github.com/NinoFloris/Repro-dotnet-sdk-issues-2721

I chose Giraffe.Razor here as the package that will trigger this case, but obviously this will happen for any other package that is itself still referencing aspnetcore 2.1 packages. It therefore mostly looks to me like some terrible error handling and surfacing rather than a restore bug.

However the real cause in the current state would be impossible to track down for most people, as I demonstrated effectively in my opening post...
In any case, problems like these should always result in downgrade warnings + package name culprit instead.

@natemcmaster
Copy link
Contributor

I think the problem more-or-less boils down to this: #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.

@NinoFloris
Copy link
Author

NinoFloris commented Dec 6, 2018

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

Edit: this repro was lifted from a project where lib was actually an entry point project and console was a test project. You're saying that even in those common cases such a workaround is the only option? Or are you saying that just the error handling is bad due to this missing framework reference. @natemcmaster

@natemcmaster
Copy link
Contributor

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.

wli3 pushed a commit that referenced this issue Feb 7, 2020
…0190907.17 (#2721)

- Microsoft.NETCore.App - 5.0.0-alpha1.19457.17

Dependency coherency updates

- System.CodeDom - 5.0.0-alpha1.19457.4 (parent: Microsoft.NETCore.App)
- System.Security.Cryptography.ProtectedData - 5.0.0-alpha1.19457.4 (parent: Microsoft.NETCore.App)
- System.Text.Encoding.CodePages - 5.0.0-alpha1.19457.4 (parent: Microsoft.NETCore.App)
Copy link
Contributor

github-actions bot commented Dec 7, 2024

Due to lack of recent activity, this issue has been labeled as 'stale'. It will be closed if no further activity occurs within 30 more days. Any new comment will remove the label.

@github-actions github-actions bot added the stale label Dec 7, 2024
Copy link
Contributor

github-actions bot commented Jan 6, 2025

This issue will now be closed since it has been labeled 'stale' without activity for 30 days.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants