-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
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
Comments
The problem persists. The latest version cannot be upgraded >6.1.0 |
It seems that there are breaking changes in the Identity Server version update, so we suggest you update instead to the latest patch version. |
which one patch version? No available version in nuget |
@neozhu I suspect you are looking for |
Currently I use this version, another issue is that Microsoft.AspNetCore.IdentityServer only depends on the automapper version< 12. |
@neozhu we do not depend directly on automapper, that must be coming from one of the IdentityServer packages. |
|
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: using Duende.IdentityServer.EntityFramework.Entities;
using Duende.IdentityServer.EntityFramework.Extensions;
using Duende.IdentityServer.EntityFramework.Interfaces;
using Duende.IdentityServer.EntityFramework.Options;
using Microsoft.AspNetCore.ApiAuthorization.IdentityServer;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.Extensions.Options;
namespace Identity.Data
{
public class User : IdentityUser
{
}
public class GraphIdentityDbContext : IdentityDbContext<User>, IPersistedGrantDbContext
{
private readonly IOptions<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>
public GraphIdentityDbContext(
DbContextOptions options,
IOptions<OperationalStoreOptions> operationalStoreOptions)
: base(options)
{
_operationalStoreOptions = operationalStoreOptions;
}
/// <summary>
/// Gets or sets the user sessions.
/// </summary>
/// <value>
/// The keys.
/// </value>
public DbSet<ServerSideSession> ServerSideSessions { get; set; }
/// <summary>
/// Gets or sets the <see cref="DbSet{PersistedGrant}"/>.
/// </summary>
public DbSet<PersistedGrant> PersistedGrants { get; set; }
/// <summary>
/// Gets or sets the <see cref="DbSet{DeviceFlowCodes}"/>.
/// </summary>
public DbSet<DeviceFlowCodes> DeviceFlowCodes { get; set; }
/// <summary>
/// Gets or sets the <see cref="DbSet{Key}"/>.
/// </summary>
public DbSet<Key> Keys { get; set; }
/// <summary>
///
/// </summary>
/// <returns></returns>
public Task<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>
protected override void OnModelCreating(ModelBuilder builder)
{
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. We just need to add the public DbSet<ServerSideSession> ServerSideSessions { get; set; } property to Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ApiAuthorizationDbContext class PR here |
I think that we are behind Duende that IPersistedGrantDbContext.ServerSideSessions property implementaion. 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 |
my solution |
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):
|
Hi all, 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)). Is there maybe some ETA on when next version will be released (or even prerelase) with fix for this issue? (3)
|
Faced the same issue! Here is how I solved it: Downgraded Now it works. |
Version 7.0.1 was just released but issue still remains. Will be there some alpha/beta/preview package for this as this error blocks development with .Net 7 |
@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 Can we use this existing issue to track this blocked upgrade, or should I create a new issue? |
Any news about this? This is currently blocking upgrading to NET7 for us. |
@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. |
@MichelJansson I have created new one #46025 |
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. |
I'm getting frustrated with There are the known errors as well: If you agree with me that Microsoft should replace |
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. |
Is there an existing issue for this?
Describe the bug
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)
$>d__0.MoveNext() in C:\Users\zhuhua\Documents\GitHub\CleanArchitectureWithBlazorServer\src\Blazor.Server.UI\Program.cs:line 55at Microsoft.AspNetCore.Mvc.Controllers.ControllerFeatureProvider.PopulateFeature(IEnumerable
1 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(Func
1 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.<
Expected Behavior
No response
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
7.0
Anything else?
No response
The text was updated successfully, but these errors were encountered: