You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Method 'get_ServerSideSessions' in type 'Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiAuthorizationDbContext`1' from assembly 'Microsoft.AspNetCore.ApiAuthorization.IdentityServer, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' does not have an implementation. #44990
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=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' does not have an implementation.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at Microsoft.AspNetCore.Mvc.Controllers.ControllerFeatureProvider.PopulateFeature(IEnumerable1 parts, ControllerFeature feature) at Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartManager.PopulateFeature[TFeature](TFeature feature) at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.GetControllerTypes() at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.GetDescriptors() at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.OnProvidersExecuting(ActionDescriptorProviderContext context) at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.UpdateCollection() at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.Initialize() at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.GetChangeToken() at Microsoft.Extensions.Primitives.ChangeToken.OnChange(Func1 changeTokenProducer, Action changeTokenConsumer)
at Microsoft.AspNetCore.Mvc.Routing.ActionEndpointDataSourceBase.Subscribe()
at Microsoft.AspNetCore.Builder.ControllerEndpointRouteBuilderExtensions.GetOrCreateDataSource(IEndpointRouteBuilder endpoints)
at Microsoft.AspNetCore.Builder.ControllerEndpointRouteBuilderExtensions.MapControllers(IEndpointRouteBuilder endpoints)
at CleanArchitecture.Blazor.Infrastructure.Extensions.ApplicationBuilderExtensions.<>c.b__0_3(IEndpointRouteBuilder endpoints) in C:\Users\zhuhua\Documents\GitHub\CleanArchitectureWithBlazorServer\src\Infrastructure\Extensions\ApplicationBuilderExtensions.cs:line 41
at Microsoft.AspNetCore.Builder.EndpointRoutingApplicationBuilderExtensions.UseEndpoints(IApplicationBuilder builder, Action`1 configure)
at CleanArchitecture.Blazor.Infrastructure.Extensions.ApplicationBuilderExtensions.UseInfrastructure(IApplicationBuilder app, IConfiguration config) in C:\Users\zhuhua\Documents\GitHub\CleanArchitectureWithBlazorServer\src\Infrastructure\Extensions\ApplicationBuilderExtensions.cs:line 39
at Program.<
$>d__0.MoveNext() in C:\Users\zhuhua\Documents\GitHub\CleanArchitectureWithBlazorServer\src\Blazor.Server.UI\Program.cs:line 55
@neozhu we do not depend directly on automapper, that must be coming from one of the IdentityServer packages.
yes, Its dependencies are Microsoft.AspNetCore.IdentityServer ->Duende.IdentityServer.EntityFramework -> AutoMapper >=11<12
hello everyone, I had the same Issue, It seems like Reflection is ussed in some part on the migration creation process so I just didn't inherit from the API ApiAuthorizationDbContext class, instead I recreate it as follows:
usingDuende.IdentityServer.EntityFramework.Entities;usingDuende.IdentityServer.EntityFramework.Extensions;usingDuende.IdentityServer.EntityFramework.Interfaces;usingDuende.IdentityServer.EntityFramework.Options;usingMicrosoft.AspNetCore.ApiAuthorization.IdentityServer;usingMicrosoft.AspNetCore.Identity;usingMicrosoft.AspNetCore.Identity.EntityFrameworkCore;usingMicrosoft.EntityFrameworkCore;usingMicrosoft.EntityFrameworkCore.Metadata;usingMicrosoft.Extensions.Options;namespaceIdentity.Data{publicclassUser:IdentityUser{}publicclassGraphIdentityDbContext:IdentityDbContext<User>,IPersistedGrantDbContext{privatereadonlyIOptions<OperationalStoreOptions>_operationalStoreOptions;/// <summary>/// Initializes a new instance of <see cref="ApiAuthorizationDbContext{TUser}"/>./// </summary>/// <param name="options">The <see cref="DbContextOptions"/>.</param>/// <param name="operationalStoreOptions">The <see cref="IOptions{OperationalStoreOptions}"/>.</param>publicGraphIdentityDbContext(DbContextOptionsoptions,IOptions<OperationalStoreOptions>operationalStoreOptions):base(options){_operationalStoreOptions=operationalStoreOptions;}/// <summary>/// Gets or sets the user sessions./// </summary>/// <value>/// The keys./// </value>publicDbSet<ServerSideSession>ServerSideSessions{get;set;}/// <summary>/// Gets or sets the <see cref="DbSet{PersistedGrant}"/>./// </summary>publicDbSet<PersistedGrant>PersistedGrants{get;set;}/// <summary>/// Gets or sets the <see cref="DbSet{DeviceFlowCodes}"/>./// </summary>publicDbSet<DeviceFlowCodes>DeviceFlowCodes{get;set;}/// <summary>/// Gets or sets the <see cref="DbSet{Key}"/>./// </summary>publicDbSet<Key>Keys{get;set;}/// <summary>/// /// </summary>/// <returns></returns>publicTask<int>SaveChangesAsync()=>base.SaveChangesAsync();/// <summary>/// Configures the schema needed for the identity framework./// </summary>/// <param name="builder">/// The builder being used to construct the model for this context./// </param>protectedoverridevoidOnModelCreating(ModelBuilderbuilder){base.OnModelCreating(builder);builder.ConfigurePersistedGrantContext(_operationalStoreOptions.Value);}}
And it works , i figured out that the property ServerSideSessions was not implemented in the API ApiAuthorizationDbContext and was required by IPersistedGrantDbContext Interface so I added it in my DbContext and It works, Is werid that If I try to inherit from ApiAuthorizationDbContext even adding the ServerSideSessions property stilll fails.
my solution
remove this package Microsoft.AspNetCore.ApiAuthorization.IdentityServer.
change service to
services
.AddIdentity<ApplicationUser, ApplicationRole>()
.AddEntityFrameworkStores()
.AddDefaultTokenProviders();
Referencing Identity Server 6.2.0 explicitly resolves the AutoMapper issues.
Then I got the exception this issue refers to due Microsoft.AspNetCore.ApiAuthorization.IdentityServer 7.0.0 not supporting IS 6.2.0, and migrations cannot be built/generated.
Using @hi-diego's workaround by duplicating ApiAuthorizationDbContext with the added DbSet<ServerSideSessions> resolves the initial exception, and I can now build the new Migration.
But now I'm getting same exception again this time when mapping endpoints (endpoints.MapRazorPages();).
It looks like some reflection code is finding the original ApiAuthorizationDbContext with the older interface even though it's not used anywhere.
Anyhow, I'm stuck.
Reacted by Zsolt Kovács, dsanabriav, Alan Biegun, Peter Grman, Hamza Yazar and Robert Peric
Hi all,
I have encountered this issue after creating .Net 7 and Angular 15 project.
As my predecessors pointed out .Net 7 needs AutoMapper 12 (1), newest IndentityServer (6.2.0) also has supports .Net 7 and uses AutoMapper 12 but at the same time they added that ServerSideSessions DbSet (2) which is not present in ApiAuthorizationDbContext of Microsoft.AspNetCore.ApiAuthorization.IdentityServer 7.0.0 (3)
I have tried to lower the versions of Duende.IdentityServer to 6.0.4 which is last version without ServerSideSessions but then I have to lower version of AutoMapper to 11 and that results in error ("violates the constraint of type parameter 'T'" (1)).
So the only solution that I see is to change version of .Net to 6 and update packages accordingly.
Is there maybe some ETA on when next version will be released (or even prerelase) with fix for this issue? (3)
Downgraded Automapper to version 10.1.1
Downgraded AutoMapper.Extensions.Microsoft.DependencyInjection to version 10.1.1
Used version 6.0.11 of everything inside Microsoft.* packages.
Removed identity packages newer then 6.0.11 (refering to the date of release)
Version 7.0.1 was just released but issue still remains.
System.AggregateException: One or more errors occurred. (Unable to load one or more of the requested types.
Method "get_ServerSideSessions" in type Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiAuthorizationDbContext
from assembly "Microsoft.AspNetCore.ApiAuthorization.IdentityServer, Version=7.0.1.0
does not have an implementation)
Will be there some alpha/beta/preview package for this as this error blocks development with .Net 7
Downgrading packages to .Net 6 should not be considered a fix.
@javiercn, @mkArtakMSFT I'm not sure if you have seen the latest development of this issue after it's been marked as discussion.
This blocks upgrade to .NET7 and I do not really see a way forward without an updated version of Microsoft.AspNetCore.ApiAuthorization.IdentityServer that uses dependencies that work on .NET7 (the external parties have updated their packages some time ago).
Can we use this existing issue to track this blocked upgrade, or should I create a new issue?
7.0.2 version is up... but no change. Can we ping someone regarding this or should we create new issue?
@Alan468 I tried pinging the MS participants a month ago, so lets create a new issue that makes it clear this is a NET7 blocker.
I will have time earliest later tonight (CET). Lets us know it you get to it first 👍
Hey folks, you have an update here that includes a workaround to make it work.
The TL;DR is that this is a breaking change introduced by Identity Server in a minor release (6.1.0) that breaks our package.
Unfortunately, I do not think we can do anything out of the box since we can't make minor version upgrades during patches, and we can't make public API changes.
With that said, the provided workaround should unblock you. If not, please let us know.
If you agree with me that Microsoft should replace Duende.IdentityServer with Microsoft.AspNetCore.Identity or a similar library created/maintained by Microsoft you can show community involvement here:
Microsoft.AspNetCore.ApiAuthorization.IdentityServer will no longer be supported going forward, so I'm closing this issue. We plan to stop shipping it in .NET 8, and we are going to be removing Duende's IdentityServer from our SPA templates. See #42158 (comment)
If you want to continue using IdentityServer, I recommend following the guidance laid out Duende's docs, templates and samples which do not use Microsoft.AspNetCore.ApiAuthorization.IdentityServer.
Activity
neozhu commentedon Nov 10, 2022
neozhu commentedon Nov 10, 2022
The problem persists. The latest version cannot be upgraded >6.1.0
javiercn commentedon Nov 10, 2022
It seems that there are breaking changes in the Identity Server version update, so we suggest you update instead to the latest patch version.
neozhu commentedon Nov 10, 2022
which one patch version? No available version in nuget
javiercn commentedon Nov 10, 2022
@neozhu I suspect you are looking for
Duende.IdentityServer...6.0.4neozhu commentedon Nov 10, 2022
Currently I use this version, another issue is that Microsoft.AspNetCore.IdentityServer only depends on the automapper version< 12.
javiercn commentedon Nov 10, 2022
@neozhu we do not depend directly on automapper, that must be coming from one of the IdentityServer packages.
neozhu commentedon Nov 11, 2022
hi-diego commentedon Nov 17, 2022
hello everyone, I had the same Issue, It seems like Reflection is ussed in some part on the migration creation process so I just didn't inherit from the API ApiAuthorizationDbContext class, instead I recreate it as follows:
And it works , i figured out that the property ServerSideSessions was not implemented in the API ApiAuthorizationDbContext and was required by IPersistedGrantDbContext Interface so I added it in my DbContext and It works, Is werid that If I try to inherit from ApiAuthorizationDbContext even adding the ServerSideSessions property stilll fails.
We just need to add the
property to Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiAuthorizationDbContext class
PR here
hi-diego commentedon Nov 17, 2022
I think that we are behind Duende that IPersistedGrantDbContext.ServerSideSessions property implementaion.
you can see the Package References
Identity -> Microsoft.AspNetCore.ApiAuthorization.IdentityServer 7.0.0 -> Duende.IdentityServer.EntityFramework (>= 6.0.4)
and you can see on Duende.IdentityServer.EntityFramework.Interfaces.IPersistedGrantDbContext.cs Definition that DbSet ServerSideSessions is required
neozhu commentedon Nov 17, 2022
my solution
remove this package Microsoft.AspNetCore.ApiAuthorization.IdentityServer.
change service to
services
.AddIdentity<ApplicationUser, ApplicationRole>()
.AddEntityFrameworkStores()
.AddDefaultTokenProviders();
MichelJansson commentedon Nov 27, 2022
Having the same issue.
My scenario (that might help others find this), and reason for not being able to stay on "latest patch" of identity server (6.0.4):
Automapper 12 is "required" for .NET7 due to new APIs.
MaxInteger[T](System.Collections.Generic.IEnumerable`1[T])' violates the constraint of type parameter 'T' exception LuckyPennySoftware/AutoMapper#3988,
[dotnet-sdk-7.0.100-preview.5.22257.3] MaxInteger[T](System.Collections.Generic.IEnumerable`1[T])' violates the constraint of type parameter 'T' exception error runtime#69119).
Identity Server < 6.2 requires AutoMapper < 12.
Referencing Identity Server 6.2.0 explicitly resolves the AutoMapper issues.
Then I got the exception this issue refers to due Microsoft.AspNetCore.ApiAuthorization.IdentityServer 7.0.0 not supporting IS 6.2.0, and migrations cannot be built/generated.
Using @hi-diego's workaround by duplicating
ApiAuthorizationDbContextwith the addedDbSet<ServerSideSessions>resolves the initial exception, and I can now build the new Migration.But now I'm getting same exception again this time when mapping endpoints (
endpoints.MapRazorPages();).It looks like some reflection code is finding the original
ApiAuthorizationDbContextwith the older interface even though it's not used anywhere.Anyhow, I'm stuck.
Alan468 commentedon Dec 7, 2022
Hi all,
I have encountered this issue after creating .Net 7 and Angular 15 project.
As my predecessors pointed out .Net 7 needs AutoMapper 12 (1), newest IndentityServer (6.2.0) also has supports .Net 7 and uses AutoMapper 12 but at the same time they added that ServerSideSessions DbSet (2) which is not present in ApiAuthorizationDbContext of Microsoft.AspNetCore.ApiAuthorization.IdentityServer 7.0.0 (3)
I have tried to lower the versions of Duende.IdentityServer to 6.0.4 which is last version without ServerSideSessions but then I have to lower version of AutoMapper to 11 and that results in error ("violates the constraint of type parameter 'T'" (1)).
So the only solution that I see is to change version of .Net to 6 and update packages accordingly.
Is there maybe some ETA on when next version will be released (or even prerelase) with fix for this issue? (3)
[dotnet-sdk-7.0.100-preview.5.22257.3] MaxInteger[T](System.Collections.Generic.IEnumerable`1[T])' violates the constraint of type parameter 'T' exception error runtime#69119
bellash13 commentedon Dec 9, 2022
Faced the same issue! Here is how I solved it:
Downgraded
Automapperto version 10.1.1Downgraded
AutoMapper.Extensions.Microsoft.DependencyInjectionto version 10.1.1Used version
6.0.11of everything insideMicrosoft.*packages.Removed identity packages newer then
6.0.11(refering to the date of release)Now it works.
Alan468 commentedon Dec 13, 2022
Version 7.0.1 was just released but issue still remains.
System.AggregateException: One or more errors occurred. (Unable to load one or more of the requested types.
Method "get_ServerSideSessions" in type Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiAuthorizationDbContext
from assembly "Microsoft.AspNetCore.ApiAuthorization.IdentityServer, Version=7.0.1.0
does not have an implementation)
Will be there some alpha/beta/preview package for this as this error blocks development with .Net 7
Downgrading packages to .Net 6 should not be considered a fix.
nuget Microsoft.AspNetCore.ApiAuthorization.IdentityServer
MichelJansson commentedon Dec 16, 2022
@javiercn, @mkArtakMSFT I'm not sure if you have seen the latest development of this issue after it's been marked as discussion.
This blocks upgrade to .NET7 and I do not really see a way forward without an updated version of
Microsoft.AspNetCore.ApiAuthorization.IdentityServerthat uses dependencies that work on .NET7 (the external parties have updated their packages some time ago).Can we use this existing issue to track this blocked upgrade, or should I create a new issue?
Drol commentedon Jan 2, 2023
Any news about this? This is currently blocking upgrading to NET7 for us.
Alan468 commentedon Jan 10, 2023
7.0.2 version is up... but no change.

Can we ping someone regarding this or should we create new issue?
MichelJansson commentedon Jan 11, 2023
@Alan468 I tried pinging the MS participants a month ago, so lets create a new issue that makes it clear this is a NET7 blocker.
I will have time earliest later tonight (CET). Lets us know it you get to it first 👍
Alan468 commentedon Jan 11, 2023
@MichelJansson I have created new one #46025
javiercn commentedon Jan 11, 2023
Hey folks, you have an update here that includes a workaround to make it work.
The TL;DR is that this is a breaking change introduced by Identity Server in a minor release (6.1.0) that breaks our package.
Unfortunately, I do not think we can do anything out of the box since we can't make minor version upgrades during patches, and we can't make public API changes.
With that said, the provided workaround should unblock you. If not, please let us know.
Ogglas commentedon Jan 17, 2023
I'm getting frustrated with
Duende.IdentityServerupdates not being compatible. Last year I had the error below that took a few hours to investigate:#41897
There are the known errors as well:
https://github.com/dotnet/core/blob/main/release-notes/6.0/known-issues.md#spa-template-issues-with-individual-authentication-when-running-in-production
#42072
If you agree with me that Microsoft should replace
Duende.IdentityServerwithMicrosoft.AspNetCore.Identityor a similar library created/maintained by Microsoft you can show community involvement here:#46131
halter73 commentedon Mar 31, 2023
Microsoft.AspNetCore.ApiAuthorization.IdentityServer will no longer be supported going forward, so I'm closing this issue. We plan to stop shipping it in .NET 8, and we are going to be removing Duende's IdentityServer from our SPA templates. See #42158 (comment)
If you want to continue using IdentityServer, I recommend following the guidance laid out Duende's docs, templates and samples which do not use Microsoft.AspNetCore.ApiAuthorization.IdentityServer.