code generator: Exception type "System.InvalidOperationException"
When I was scaffolding a controller in ASP.Net using Entity Framework Core it threw this error. I searched google, stackoverflow but didn't find out any solution for this error. What part should I check to fix it ?
2 Replies
maybe try runnng scaffolding on a reduced sample?
I have fixed it. The issue was caused by adding both NuGet packages: Microsoft.AspNetCore.Identity.EntityFrameworkCore and Microsoft.AspNetCore.Identity. The tools didn’t know which IdentityUser to use for scaffolding. By deleting the lower version of the NuGet package, the problem was resolved.