Skip to content
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

Detected package version outside of dependency constraint: Duende.IdentityServer.EntityFramework.Storage 5.2.0 #41897

Closed
1 task done
Ogglas opened this issue May 27, 2022 · 12 comments
Assignees
Labels
area-identity Includes: Identity and providers ✔️ Resolution: Won't Fix Resolved because we decided not to change the behavior reported in this issue. Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. Status: Resolved

Comments

@Ogglas
Copy link

Ogglas commented May 27, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

I got a warning/error in Visual Studio when installing NuGet AutoMapper:

NU1608 Detected package version outside of dependency constraint:
Duende.IdentityServer.EntityFramework.Storage 5.2.0 requires
AutoMapper (>= 10.0.0 && < 11.0.0) but version AutoMapper 11.0.1 was
resolved.

I tracked this to NuGet Microsoft.AspNetCore.ApiAuthorization.IdentityServer

https://www.nuget.org/packages/Microsoft.AspNetCore.ApiAuthorization.IdentityServer

If you look at Microsoft.AspNetCore.ApiAuthorization.IdentityServer NuGet dependencies is:

  • net6.0
  • Duende.IdentityServer (>= 5.2.0)
  • Duende.IdentityServer.AspNetIdentity (>= 5.2.0)
  • Duende.IdentityServer.EntityFramework (>= 5.2.0)
  • Duende.IdentityServer.EntityFramework.Storage (>= 5.2.0)
  • Duende.IdentityServer.Storage (>= 5.2.0)
  • Microsoft.AspNetCore.Authentication.JwtBearer (>= 6.0.5)
  • Microsoft.AspNetCore.Identity.EntityFrameworkCore (>= 6.0.5)
  • Microsoft.AspNetCore.Identity.UI (>= 6.0.5)
  • Microsoft.Extensions.Http (>= 6.0.0)
  • Newtonsoft.Json (>= 13.0.1)

I can solve the warning manually by updating the libraries below:

  • Duende.IdentityServer
  • Duende.IdentityServer.AspNetIdentity
  • Duende.IdentityServer.EntityFramework
  • Duende.IdentityServer.EntityFramework.Storage
  • Duende.IdentityServer.Storage

Duende.IdentityServer.EntityFramework.Storage 6.1.0 has the following dependencies which will fix it:

  • net6.0
  • AutoMapper (>= 11.0.0 && < 12.0.0)
  • Duende.IdentityServer.Storage (>= 6.1.0)
  • Microsoft.EntityFrameworkCore.Relational (>= 6.0.0)

https://www.nuget.org/packages/Duende.IdentityServer.EntityFramework.Storage/

However this led to the exception below after running a migration in endpoints.MapRazorPages();.

System.Reflection.ReflectionTypeLoadException: 'Unable to load one or
more of the requested types. Method 'get_ServerSideSessions' in type
'Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiAuthorizationDbContext`1'
from assembly 'Microsoft.AspNetCore.ApiAuthorization.IdentityServer,
Version=6.0.5.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
does not have an implementation.'

Describe the solution you'd like

Latest Microsoft.AspNetCore.ApiAuthorization.IdentityServer should be compatible with latest Duende.IdentityServer.EntityFramework.Storage

Additional context

No response

@javiercn javiercn added the area-identity Includes: Identity and providers label May 28, 2022
@StonedHackerman
Copy link

same issue

@wtgodbe
Copy link
Member

wtgodbe commented Jun 1, 2022

@HaoK related to #41315, do we need to backport that change to 6.0?

@HaoK
Copy link
Member

HaoK commented Jun 1, 2022

I don't think so, upgrading versions for 7 isn't the same thing as bumping up versions in 6, if they are able to upgrade the packages to make everything work.

@Ogglas is everything working after you upgraded all of the relevant duende packages yourself?

@Tratcher Tratcher added the Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label Jun 3, 2022
@ghost
Copy link

ghost commented Jun 3, 2022

Hi @Ogglas. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@ghost
Copy link

ghost commented Jun 7, 2022

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

See our Issue Management Policies for more information.

@Ogglas
Copy link
Author

Ogglas commented Jun 8, 2022

@HaoK Nope I got the exception below in endpoints.MapRazorPages(); so I had to revert.

System.Reflection.ReflectionTypeLoadException: 'Unable to load one or
more of the requested types. Method 'get_ServerSideSessions' in type
'Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiAuthorizationDbContext`1'
from assembly 'Microsoft.AspNetCore.ApiAuthorization.IdentityServer,
Version=6.0.5.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
does not have an implementation.'

@ghost ghost added Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. Status: No Recent Activity labels Jun 8, 2022
@BrennanConroy
Copy link
Member

BrennanConroy commented Jun 8, 2022

Looks like there may be breaking changes between Duende 5.x and 6.x. We recommend replacing the incompatible identity packages/dbcontext since we can't update the dependency in .net 6.0 as it may be breaking. Your best bet is to consult the migration docs https://docs.duendesoftware.com/identityserver/v6/upgrades/v5.2_to_v6.0/ but this isn't something we are directly supporting for 6.0

@BrennanConroy BrennanConroy added the ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. label Jun 8, 2022
@ghost ghost added the Status: Resolved label Jun 8, 2022
@BrennanConroy BrennanConroy removed ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. Status: Resolved labels Jun 8, 2022
@BrennanConroy BrennanConroy assigned HaoK and unassigned wtgodbe Jun 8, 2022
@HaoK HaoK added the ✔️ Resolution: Won't Fix Resolved because we decided not to change the behavior reported in this issue. label Jun 8, 2022
@ghost ghost added the Status: Resolved label Jun 8, 2022
@HaoK HaoK closed this as not planned Won't fix, can't repro, duplicate, stale Jun 8, 2022
@picBuilderLabs
Copy link

Getting the following exception
System.Reflection.ReflectionTypeLoadException: 'Unable to load one or more of the requested types. Method 'get_ServerSideSessions' in type 'Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiAuthorizationDbContext1' from assembly `
after updating the nuget package Duende.IdentityServer.EntityFramework to version 6.1.0. Reverting this package back to 6.0.4 resolves this error , seems like there is an incompatibility introduced. If anyone has a fix so I can upgrade this package is appreciated.

@neozhu
Copy link

neozhu commented Jun 17, 2022

@picBuilderLabs
I have the same problem when upgrading to Duende.IdentityServer.EntityFramework to version 6.1.0.

@borgarer
Copy link

@picBuilderLabs same issue here. Have you guys found any workarounds orther than reverting back to 6.0.4?

@yakeer
Copy link

yakeer commented Jul 19, 2022

Any news on this issue?

@borgarer
Copy link

Hi @yakeer
In my case, it turned out that I wasn't actually using anything from the Microsoft.AspNetCore.ApiAuthorization.IdentityServer package. So by removing its reference from my .csproj the exception disappeared.

I see they have releaased v. 6.0.7 only 7 days ago. You might also want to try and see if the issue has been addressed there.

@ghost ghost locked as resolved and limited conversation to collaborators Aug 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-identity Includes: Identity and providers ✔️ Resolution: Won't Fix Resolved because we decided not to change the behavior reported in this issue. Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. Status: Resolved
Projects
None yet
Development

No branches or pull requests