Open Lavshyak opened 1 week ago
when i do this, there is no exception: serviceScope3: mainDbContext.Attach(userToRemember)
so i don't think the problem is in DbContext
and it's no matter i remember account from servicesScope0 or servicesScope1. so i think the problem is either in the UserManager from scope0 or from scope3
Is there an existing issue for this?
Describe the bug
Expected Behavior
no exception
Steps To Reproduce
Project with code to reproduce: https://github.com/Lavshyak/AspNetIdentityUserManagerBug
Exceptions (if any)
InvalidOperationException with message: "The instance of entity type 'Account' cannot be tracked because another instance with the same key value for {'Id'} is already being tracked. When attaching existing entities, ensure that only one entity instance with a given key value is attached..."
.NET Version
8.0.403 9.0.100
Anything else?
ASP.NET 8.0.10 ASP.NET 9.0.0 Rider 2024.2.7
dotnet --info when .net 8:
.NET SDK: Version: 8.0.403 Commit: c64aa40a71 Workload version: 8.0.400-manifests.e99c892e MSBuild version: 17.11.9+a69bbaaf5
Runtime environment: OS Name: Windows OS Version: 10.0.22631 OS Platform: Windows RID: win-x64 Base Path: C:\Program Files\dotnet\sdk\8.0.403\
Installed .NET Workloads: Configured to use loose manifests when installing new manifests. There are no installed workloads to display.
Host: Version: 8.0.10 Architecture: x64 Commit: 81cabf2857
.NET SDKs installed: 8.0.403 [C:\Program Files\dotnet\sdk]
.NET runtimes installed: Microsoft.AspNetCore.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 8.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found: x86 [C:\Program Files (x86)\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables: Not set
global.json file: Not found
dotnet --info when .net 9:
.NET SDK: Version: 9.0.100 Commit: 59db016f11 Workload version: 9.0.100-manifests.c6f19616 MSBuild version: 17.12.7+5b8665660
Runtime environment: OS Name: Windows OS Version: 10.0.22631 OS Platform: Windows RID: win-x64 Base Path: C:\Program Files\dotnet\sdk\9.0.100\
Installed .NET Workloads: Configured to use loose manifests when installing new manifests. There are no installed workloads to display.
Host: Version: 9.0.0 Architecture: x64 Commit: 9d5a6a9aa4
.NET SDKs installed: 9.0.100 [C:\Program Files\dotnet\sdk]
.NET runtimes installed: Microsoft.AspNetCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found: x86 [C:\Program Files (x86)\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables: Not set
global.json file: Not found