Page 1 of 1

ABP Template .Net Core 1.1 MVC - EF Migration error

PostPosted: Tue Jun 13, 2017 4:42 am
by exlnt
I just downloaded the latest version of ABP template for new project.
I am using the .NET Core 1.1 MVC template.

So far the only change I have made is add my custom entity classes into MyProject.Core project. After adding them, I updated the DBContext and was setting up the first EF migration. Soon as I run the add migration cmd I get the error below.
Code: Select allSystem.InvalidOperationException: Unable to determine the relationship represented by navigation property 'User.DeleterUser' of type 'User'. Either manually configure the relationship, or ignore this property from the model.
   at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.PropertyMappingValidationConvention.Apply(InternalModelBuilder modelBuilder)
   at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher.OnModelBuilt(InternalModelBuilder modelBuilder)
   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.ServiceProvider.<>c__DisplayClass16_0.<RealizeService>b__0(ServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitTransient(TransientCallSite transientCallSite, ServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitTransient(TransientCallSite transientCallSite, 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.Design.Internal.MigrationsOperations.AddMigration(String name, String outputDir, String contextType)
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.AddMigrationImpl(String name, String outputDir, String contextType)
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.<>c__DisplayClass3_0`1.<Execute>b__0()
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
Unable to determine the relationship represented by navigation property 'User.DeleterUser' of type 'User'. Either manually configure the relationship, or ignore this property from the model.


None of my custom entities has this property, so I dont understand where this is coming from?

Re: ABP Template .Net Core 1.1 MVC - EF Migration error

PostPosted: Thu Jun 15, 2017 7:58 pm
by bluetsx
I am getting the same error too from the template I downloaded.

Re: ABP Template .Net Core 1.1 MVC - EF Migration error

PostPosted: Mon Jun 19, 2017 4:33 pm
by bluetsx
Can anyone from ASPNETZERO support team respond to this thread please?

I am unable to get past this error and I cannot use the template right now.

Re: ABP Template .Net Core 1.1 MVC - EF Migration error

PostPosted: Wed Jun 21, 2017 2:24 am
by ismcagdas
Hi @bluetsx, @exlnt,

Sorry for the late response first of all.
Can you share entity definition ? We will try it as soon as possible when you send your entity definition.

Thanks.

Re: ABP Template .Net Core 1.1 MVC - EF Migration error

PostPosted: Tue Jul 11, 2017 6:30 am
by alper
Hi,
The problem was solved here
viewtopic.php?f=5&t=9197&p=21059#p21033