Thank you for your response @demirmusa.
Hello Velu,
I am also working on a project that needs integration with DevExpress Reporting. Would you mind sending a sample code please?
Kindly send to [email protected]
Thank you in advance.
Yes that's what I did actually. I used sa and even created a new login with all permissions just to confirm the issue. When the database I want created is not existing in SQL Server, creating the new tenant does not work and throws an internal server error. But if I create the database prior to creating the tenant, it works. Now checking the Audit Log, I can see that the issue is this...
Microsoft.Data.SqlClient.SqlException (0x80131904): CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file 'C:\Users\administratorSonetaDb-myDb.mdf'. CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
If it helps, I am using MSSqlLocalDb edition of MS SQL Server.
I think I figured it out. It has something to do with my connection string where the database must be created already in the backend and use SQL Authentication instead of Windows Authentication for better security and elevated permission. The only thing I am concerned though is that I need to manually create the new tenant database first before the migration happens. I wanted this to be part of the automated, non-user interactive approach. My use case is that, I will be having a registration page for new companies and I want them to be in their own database but I don't want to do that manually myself. Is there a way to accomplish this without user intervention?
Okay thanks for the tip. Will give it a try. Thank you!
Hello maliming. I used the .NET Core 3.1 SDK.
I went ahead and recreated everything from scratch. If you are able to replicate this from a clean build and just try to create a simple entity that has a tenant and then remove it from tenancy after all the migration, you will encounter the issue. Hopefully something the tool can fix in the furture. Especially for the likes of me that would want to rely mostly on the tool for scaffolding and regeneration of the assets. Nonetheless, I appreciate your help maliming. You have a great RAD tool. I will continue to push forward with my project and report back any issues I may find.
PM> dotnet build Soneta.Web.sln Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Core Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 76.82 ms for C:\Soneta\aspnet-core\src\Soneta.Core\Soneta.Core.csproj. Restore completed in 68.63 ms for C:\Soneta\aspnet-core\src\Soneta.Application.Shared\Soneta.Application.Shared.csproj. Restore completed in 76.24 ms for C:\Soneta\aspnet-core\src\Soneta.Core.Shared\Soneta.Core.Shared.csproj. Restore completed in 6.21 ms for C:\Soneta\aspnet-core\src\Soneta.EntityFrameworkCore\Soneta.EntityFrameworkCore.csproj. Restore completed in 1.27 sec for C:\Soneta\aspnet-core\src\Soneta.Migrator\Soneta.Migrator.csproj. Restore completed in 1.26 sec for C:\Soneta\aspnet-core\src\Soneta.GraphQL\Soneta.GraphQL.csproj. Restore completed in 1.39 sec for C:\Soneta\aspnet-core\src\Soneta.Application\Soneta.Application.csproj. Restore completed in 34.19 ms for C:\Soneta\aspnet-core\test\Soneta.ConsoleApiClient\Soneta.ConsoleApiClient.csproj. Restore completed in 3.17 sec for C:\Soneta\aspnet-core\src\Soneta.Web.Core\Soneta.Web.Core.csproj. Restore completed in 1.96 sec for C:\Soneta\aspnet-core\test\Soneta.GraphQL.Tests\Soneta.GraphQL.Tests.csproj. Restore completed in 2.77 sec for C:\Soneta\aspnet-core\src\Soneta.Web.Public\Soneta.Web.Public.csproj. Restore completed in 2.81 sec for C:\Soneta\aspnet-core\src\Soneta.Web.Host\Soneta.Web.Host.csproj. Restore completed in 1.16 sec for C:\Soneta\aspnet-core\test\Soneta.Test.Base\Soneta.Test.Base.csproj. Restore completed in 1.2 sec for C:\Soneta\aspnet-core\test\Soneta.Tests\Soneta.Tests.csproj. Soneta.Core.Shared -> C:\Soneta\aspnet-core\src\Soneta.Core.Shared\bin\Debug\netstandard2.0\Soneta.Core.Shared.dll Authorization\AppAuthorizationProvider.cs(57,17): error CS0128: A local variable or function named 'postalCodes' is already defined in this scope [C:\Soneta\aspnet-core\src\Soneta.Core\Soneta.Core.csproj] Authorization\AppAuthorizationProvider.cs(71,17): error CS0128: A local variable or function named 'countries' is already defined in this scope [C:\Soneta\aspnet-core\src\Soneta.Core\Soneta.Core.csproj] Authorization\AppAuthorizationProvider.cs(78,17): error CS0128: A local variable or function named 'currencies' is already defined in this scope [C:\Soneta\aspnet-core\src\Soneta.Core\Soneta.Core.csproj] Soneta.Application.Shared -> C:\Soneta\aspnet-core\src\Soneta.Application.Shared\bin\Debug\netstandard2.0\Soneta.Application.Shared.dll Soneta.ConsoleApiClient -> C:\Soneta\aspnet-core\test\Soneta.ConsoleApiClient\bin\Debug\netcoreapp3.1\Soneta.ConsoleApiClient.dll
Build FAILED.
Authorization\AppAuthorizationProvider.cs(57,17): error CS0128: A local variable or function named 'postalCodes' is already defined in this scope [C:\Soneta\aspnet-core\src\Soneta.Core\Soneta.Core.csproj] Authorization\AppAuthorizationProvider.cs(71,17): error CS0128: A local variable or function named 'countries' is already defined in this scope [C:\Soneta\aspnet-core\src\Soneta.Core\Soneta.Core.csproj] Authorization\AppAuthorizationProvider.cs(78,17): error CS0128: A local variable or function named 'currencies' is already defined in this scope [C:\Soneta\aspnet-core\src\Soneta.Core\Soneta.Core.csproj] 0 Warning(s) 3 Error(s)
Time Elapsed 00:00:18.16
-> CurrenciesAppService.cs is being generated. -> ICurrenciesAppService.cs is being generated. -> CurrencyConsts.cs is being generated. -> CreateOrEditCurrencyDto.cs is being generated. -> CurrencyDto.cs is being generated. -> GetAllCurrenciesForExcelInput.cs is being generated. -> GetAllForLookupTableInput.cs is being generated. -> GetAllCurrenciesInput.cs is being generated. -> GetCurrencyForViewDto.cs is being generated. -> GetCurrencyForEditOutput.cs is being generated. -> Currency.cs is being generated. -> CurrenciesExcelExporter.cs is being generated. -> ICurrenciesExcelExporter.cs is being generated. -> AppPermissions.cs is being modified. -> AppAuthorizationProvider.cs is being modified. -> EntityHistoryHelper.cs is being modified. -> SonetaDbContext.cs is being modified. -> CustomDtoMapper.cs is being modified. Running add-migration... Build started... Build failed. Running update-database... Build started... Build failed. -> currencies.component.ts is being generated. -> currencies.component.html is being generated. -> create-or-edit-currency-modal.component.html is being generated. -> create-or-edit-currency-modal.component.ts is being generated. -> view-currency-modal.component.html is being generated. -> view-currency-modal.component.ts is being generated. -> admin.module.ts is being modified. -> admin-routing.module.ts is being modified. -> app-navigation.service.ts is being modified. -> service-proxy.module.ts is being modified. -> Soneta.xml is being modified.
Code generation is complete. Press ENTER to exit...
I even dropped and created the database from scratch but I get the same error and no tables were created.
Hello maliming,
I am using the latest angular 8 + .net core combo. Yes other themes are affected.
Thanks!