Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 4737

Didnt Follow Googled Explanations - The entity type 'IdentityUserLogin' requires a primary key to be defined.

$
0
0

I have imported my existing app into a new one to add authentication.  

However now it wont load giving me :

System.InvalidOperationException occurred  HResult=0x80131509  Message=The entity type 'IdentityUserLogin<string>' requires a primary key to be defined.  Source=<Cannot evaluate the exception source>  StackTrace:   at Microsoft.EntityFrameworkCore.Internal.ModelValidator.ShowError(String message)   at Microsoft.EntityFrameworkCore.Internal.ModelValidator.Validate(IModel model)   at Microsoft.EntityFrameworkCore.Internal.RelationalModelValidator.Validate(IModel model)   at Microsoft.EntityFrameworkCore.Infrastructure.ModelSource.CreateModel(DbContext context, IConventionSetBuilder conventionSetBuilder, IModelValidator validator)   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)   at Microsoft.EntityFrameworkCore.Internal.DbContextServices.CreateModel()   at Microsoft.EntityFrameworkCore.Internal.LazyRef`1.get_Value()   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider)   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProvider provider)   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider)   at Microsoft.Extensions.DependencyInjection.ServiceProvider.<>c__DisplayClass16_0.<RealizeService>b__0(ServiceProvider provider)   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)   at Microsoft.EntityFrameworkCore.Infrastructure.EntityFrameworkServiceCollectionExtensions.<>c.<AddEntityFramework>b__0_13(IServiceProvider p)   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider)   at Microsoft.Extensions.DependencyInjection.ServiceProvider.<>c__DisplayClass16_0.<RealizeService>b__0(ServiceProvider provider)   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)   at Microsoft.EntityFrameworkCore.Infrastructure.AccessorExtensions.GetService[TService](IInfrastructure`1 accessor)   at Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.get_DatabaseCreator()   at Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.EnsureCreated()   at Eva804.Models.DbInitializer.Initialize(Eva804Context context) in D:\Update\EVA\EVA\Data\DbInitializer.cs:line 14   at EVA.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, Eva804Context context) in D:\Update\EVA\EVA\Startup.cs:line 107

I tried to follow the explanations on Stack Overflow but got more confused than illuminated.  Can someone guide me through this?


Viewing all articles
Browse latest Browse all 4737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>