0
votes

I thought I'd try out the standard layered ASP.NET Core 3.1 Abp.io template available at: https://Abp.io

I've followed the setup instructions, running the migration scripts to create the host database in localdb, and am able to successfully load the UI.

I login with the default credentials, then I create a new Tenant under 'Tenant Management' in the UI. I specify a custom database connection string for that tenant.

I open SQL Server Management Studio and create an empty database matching this in localdb.

Next, I logout of the admin host user, then press 'switch tenant' and type in the tenant name I just created. It gets stuck on loading, and there's a bunch of SQL Exceptions, then finally it gives up and shows the unable to connect error.

What steps do I need to take to setup a separate database for a tenant? Are there any migration scripts I need to run after creating the empty database?

1
When I repeat the process using a SQL Server running on localhost, instead of localdb, it is able to connect. I receive the following error: An unhandled exception occurred while processing the request. SqlException: Invalid object name 'AbpSettings'. Microsoft.Data.SqlClient.SqlCommand+<>c.b__164_0(Task result) DependencyResolutionException: An exception was thrown while invoking the constructor 'Void .ctor(Volo.Abp.Identity.IdentityUserStore, Microsoft.Extensions.Options.IOptions1[Microsoft.AspNetCore.Identity.IdentityOptions] .........Aidan
Include the full stack trace in your question.aaron
Hey @Aaron, I think it's just a case this feature hasn't been developed yet. When I create that table manually, and every subsequent table it throws an error for, it works! :)Aidan

1 Answers

0
votes

@Aidan, I think you need to run the DbMigrator again after creating a new Tenant using a newly introduced connection string. The migration tool should traverse the tenancy connection strings a apply the latest migration. Then you should be able to utilize the new Tenant. Hope that helps.