After fresh install and running Update-Database, i do not see any user in my local db. I do see all the tables created but no data including user table.
Here is my connection string. Server=(localdb)\MSSQLLocalDB;Initial Catalog=xxDb;Integrated Security=True;
I have tried this with demo application and it worked. This is not working only after i downloaded the premium code. Need help.
9 Answer(s)
-
0
The application will automatically initialize the data when it starts. So start your website.
-
0
Additional information on my error: I have disabled multi-tenant and also i see that the seedHelper.cs code is not getting called when i run the host. Also i see that the seed folder is under the Migration folder vs seed folder found under EntityFrameworkCore folder for demo sites.
-
0
<cite>maliming: </cite> The application will automatically initialize the data when it starts. So start your website.
Hi I ran the site but still not working and there are no data in the table. I still see the seed code is not getting called.
I have the host running and when i run the angular site, i get internal error because there is no data.
-
0
Hi,
Do you have this line <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/blob/dev/aspnet-core/src/MyCompanyName.AbpZeroTemplate.EntityFrameworkCore/EntityFrameworkCore/DatabaseCheckHelper.cs#L37">https://github.com/aspnetzero/aspnet-ze ... per.cs#L37</a> in your DatabaseCheckHelper.cs class ? There was a similar bug but fixed.
-
0
OK, this is what i found. I went back and enabled multi-tenant and then ran the host and the site, then it created the user data. But there is a new problem. I have 2 admin account now in my user table. One with shouldChangePasswordOnNextLogin = true and the other one is false. I dont know what's going on.
-
0
additional difference in 2 admin rows. One had tenant id and one does not. Not this make sense that one of them is for the tenant. Now my only question is why do i have to enable multi-tenant to get the site working even if i dont want multi-tenant.
-
0
-
0
Tested with aspnetzero 5.5.2 and I am able to reproduce the issue.
- Download new template
- dotnet ef update database
- Set Const.MultiTenancyEnabled = false
- Run Web.Host project
SeedHostDb() will be skipped at <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/blob/dev/aspnet-core/src/MyCompanyName.AbpZeroTemplate.EntityFrameworkCore/EntityFrameworkCore/AbpZeroTemplateEntityFrameworkCoreModule.cs#L61">https://github.com/aspnetzero/aspnet-ze ... ule.cs#L61</a>
Because DatabaseCheckHelper.Exist() return false
As mentioned by @ismcagdas, the issue may be related to <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/blob/dev/aspnet-core/src/MyCompanyName.AbpZeroTemplate.EntityFrameworkCore/EntityFrameworkCore/DatabaseCheckHelper.cs#L37">https://github.com/aspnetzero/aspnet-ze ... per.cs#L37</a>
Also, I found that when DatabaseCheckHelper.Exist() open database connection, null multiTenancySide is passed into <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.EntityFrameworkCore/EntityFrameworkCore/Uow/UnitOfWorkExtensions.cs#L24">https://github.com/aspnetboilerplate/as ... ons.cs#L24</a>
Subsequently, it is used in <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.EntityFrameworkCore/EntityFrameworkCore/Uow/EfCoreUnitOfWork.cs#L99">https://github.com/aspnetboilerplate/as ... ork.cs#L99</a> and <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.EntityFrameworkCore/EntityFrameworkCore/Uow/EfCoreUnitOfWork.cs#L107">https://github.com/aspnetboilerplate/as ... rk.cs#L107</a>
Ultimately, when getting database connection at <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.ZeroCore.EntityFrameworkCore/Zero/EntityFrameworkCore/DbPerTenantConnectionStringResolver.cs#L40">https://github.com/aspnetboilerplate/as ... ver.cs#L40</a>
Since multiTenancySide is null and it will attempt to retrieve tenant database connection.
-
0
thanks @ryancyq for the complete report.