C
C#4mo ago
Menhythien

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 ?
No description
2 Replies
Omnissiah
Omnissiah4mo ago
maybe try runnng scaffolding on a reduced sample?
Menhythien
MenhythienOP4mo ago
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.
Want results from more Discord servers?
Add your server