I just downloaded v4.1 for my MVC template. All I have done so far is update the connection string. I have not made any other changes to the downloaded template. Every page reports the below error on chrome console. [attachment=0:3n2izge8]Screenshot (47).png[/attachment:3n2izge8] None of the JTable grids are loading.
@ismcagdas - Thank you very much!
One other issue I am having on this same template is with the localization function "L". I copied the tenant index view and just updated the fields for my custom entity. On my new copied page I keep getting error "L does not exist in this context" I have all the same using statements and my controller inherits from the same base controller. My page, controller and views are all located in the Areas/App/ folder structure.
I just replicated the problem with a fresh template download just now.
Steps:
Here is the complete error message.
System.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.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.<AddQuery>b__1_3(IServiceProvider p)
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.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.GetService[T](IServiceProvider provider)
at Microsoft.EntityFrameworkCore.Infrastructure.AccessorExtensions.GetService[TService](IInfrastructure`1 accessor)
at Microsoft.EntityFrameworkCore.DbContext.get_QueryProvider()
at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.<.ctor>b__3_0()
at Microsoft.EntityFrameworkCore.Internal.LazyRef`1.get_Value()
at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.System.Linq.IQueryable.get_Provider()
at System.Linq.Queryable.FirstOrDefault[TSource](IQueryable`1 source, Expression`1 predicate)
at Exlnt.RemodelOps.EntityFrameworkCore.Seed.Host.DefaultEditionCreator.CreateEditions() in D:\VisualStudioOnline\RemodelOps\src\Exlnt.RemodelOps.EntityFrameworkCore\EntityFrameworkCore\Seed\Host\DefaultEditionCreator.cs:line 24
at Exlnt.RemodelOps.EntityFrameworkCore.Seed.Host.DefaultEditionCreator.Create() in D:\VisualStudioOnline\RemodelOps\src\Exlnt.RemodelOps.EntityFrameworkCore\EntityFrameworkCore\Seed\Host\DefaultEditionCreator.cs:line 19
at Exlnt.RemodelOps.EntityFrameworkCore.Seed.Host.InitialHostDbBuilder.Create() in D:\VisualStudioOnline\RemodelOps\src\Exlnt.RemodelOps.EntityFrameworkCore\EntityFrameworkCore\Seed\Host\InitialHostDbBuilder.cs:line 14
at Exlnt.RemodelOps.EntityFrameworkCore.Seed.SeedHelper.SeedHostDb(RemodelOpsDbContext context) in D:\VisualStudioOnline\RemodelOps\src\Exlnt.RemodelOps.EntityFrameworkCore\EntityFrameworkCore\Seed\SeedHelper.cs:line 25
at Exlnt.RemodelOps.EntityFrameworkCore.Seed.SeedHelper.WithDbContext[TDbContext](IIocResolver iocResolver, Action`1 contextAction) in D:\VisualStudioOnline\RemodelOps\src\Exlnt.RemodelOps.EntityFrameworkCore\EntityFrameworkCore\Seed\SeedHelper.cs:line 41
at Exlnt.RemodelOps.EntityFrameworkCore.Seed.SeedHelper.SeedHostDb(IIocResolver iocResolver) in D:\VisualStudioOnline\RemodelOps\src\Exlnt.RemodelOps.EntityFrameworkCore\EntityFrameworkCore\Seed\SeedHelper.cs:line 17
at Exlnt.RemodelOps.EntityFrameworkCore.RemodelOpsEntityFrameworkModule.PostInitialize() in D:\VisualStudioOnline\RemodelOps\src\Exlnt.RemodelOps.EntityFrameworkCore\EntityFrameworkCore\RemodelOpsEntityFrameworkModule.cs:line 40
at System.Collections.Generic.List`1.ForEach(Action`1 action)
at Abp.AbpBootstrapper.Initialize()
at Abp.AspNetCore.AbpApplicationBuilderExtensions.UseAbp(IApplicationBuilder app, Action`1 optionsAction)
at Exlnt.RemodelOps.Web.Startup.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) in D:\VisualStudioOnline\RemodelOps\src\Exlnt.RemodelOps.Web.Mvc\Startup\Startup.cs:line 56
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
I did one more test.
<cite>ismcagdas: </cite> Hi,
I have followed below approach in one of my previous projects.
- I have created POCO entities from existing database tables.
- Then I have created the initial migration file and deleted it's content.
- Applied this empty initial migration to database.
- Then I was able to use code first migrations for my new entities.
If you completely want to disable migrations, you can change this line <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/blob/master/src/MyCompanyName.AbpZeroTemplate.EntityFramework/AbpZeroTemplateDataModule.cs#L17">https://github.com/aspnetzero/aspnet-ze ... ule.cs#L17</a> to
Database.SetInitializer(null);
Thanks.
Can you please share the steps for doing this in .NET Core template?
I have emailed a link to my solution for you to review the error. I could not respond on the original thread as it has been locked.
Thanks!
Can someone from support please respond here. I have tried two template downloads and I keep getting this error. My project is not able to move forward.
I am unable to get past this error. Can someone from the support team please help here?
I posted this [https://forum.aspnetboilerplate.com/viewtopic.php?f=2&t=9090]) the other day. Today I downloaded the .Net Core 1.1 template again and added just a couple of entity classes. Soon as the migration is scaffolded or the app is run the error appears. Has anyone else run into this issue?
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.
System.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?
Amazing, that simple change worked!!
function CreateFundingSourceCombo(fsc, FSCAdd) {
var _comboService = abp.services.app.nurseHomeFundingCombo;
_comboService.createNurseHomeFundingCombo(fsc)
.done(function (result) {