Navigation property 'Claims' on entity of type 'User' cannot be loaded because the entity is not being tracked.
See original GitHub issueAbp Version:3.6.2 .Net Core Version:2.1.0 Ef Core Version:2.1
When I upgrade to .net core 2.1, after the user login in, idle for a period of time (without any operation and not close browser), it will throw the following error:
InvalidOperationException: Navigation property 'Claims' on entity of type 'User' cannot be loaded because the entity is not being tracked. Navigation properties can only be loaded for tracked entities.
Issue Analytics
- State:
- Created 5 years ago
- Comments:24 (12 by maintainers)
Top Results From Across the Web
Best way to load navigation properties in new entity
I have tried to use _context.Entry(statistic).Reference(s => s.User).Load(); method and got exception while submitting entity to database: ...
Read more >Tracking vs. No-Tracking Queries - EF Core
EF Core also fixes up navigation properties between the entities in a tracking query result and the entities that are in the change...
Read more >The navigation 'IdentityUser.Claims' cannot be loaded ...
Claims ' cannot be loaded because the entity is not being tracked. Navigations can only be loaded for tracked entities. #4771.
Read more >How do you manage non-loaded navigation properties in ...
If you try to use a navigation property, which is not yet loaded, you'll get a NullReferenceException at runtime.
Read more >Navigation Property With Code First ...
In this article, you will learn about Navigation Property with code first and navigation property in Entity Framework.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Identity 2.1 made some changes. It re-registered with ISecurityStampValidator
AddSignInManagerDeps
It covers AddAbpSecurityStampValidator<UserSecurityStampValidator>()
So only need to change the registration order can be solved.
Hi,
This is happening for us also after upgrade from 3.5.x to 3.7. We are using Kesteral hosting, so anything to do with IIS recycling can be discounted. (we are still in development only)
What i have found solves the problem is to delete all cookies and restart the browser, at this point you are asked to log in again, and all is well-- clearly not a production solution.
Will update if i learn more about how to reproduce.