- ABP Framework version: v8.0
- UI Type: Angular
- Database System: EF Core (PostgreSQL)
- Tiered (for MVC) or Auth Server Separated (for Angular): yes
- Exception message and full stack trace: no error
- Steps to reproduce the issue: unsure
Following up on the last question with the migration to commercial: https://support.abp.io/QA/Questions/7345/Dependency-Injection-Exception-after-migration-from-open-source-to-commercial#answer-3a133714-a55b-6664-d7c0-1370c2b2102b
We now noticed that the DbMigrator does not work at all. When executed with dotnet run
, there is no log output, no console output and nothing changes in the db.
I did confirm that it worked before, so it must be because of the changes while migrating to abp commercial.
dotnet -d run
simply gives:
Telemetry is: Enabled
...\aspnet-core\src\Common\cap.DbMigrator\bin\Debug\net8.0\cap.DbMigrator.exe wird ausgeführt.
Prozess-ID: 42116
and nothing more.
I don't even know how to debug this since there is no error message. It simply does nothing.
The only thing I could find where dotnet
has the same behaviour is this: https://github.com/dotnet/sdk/issues/36819 where the error was in a false appsettings.json. During migration, I did fill the previously empty appsettings.secrets.json
with the AbpLicenceCode
. Maybe there is an issue with that?
Has anyone ever encountered this and can help?
7 Answer(s)
-
0
-
0
-
0
Hi,
Is this still not working? Could you share a simple example project with me? I will check it. shiwei.liang@volosoft.com
-
0
Further investigations:
dotnet build
works without issues- The error occures in
await application.InitializeAsync();
inStartAsync()
inDbMigratorHostedService.cs
:
public async Task StartAsync(CancellationToken cancellationToken) { Console.WriteLine("Starting DbMigrator..."); using var application = await AbpApplicationFactory.CreateAsync<CapDbMigratorModule>(options => { options.Services.ReplaceConfiguration(_configuration); options.Services.ReplaceConfiguration(BuildConfiguration()); options.UseAutofac(); options.Services.AddLogging(c => c.AddSerilog()); options.AddDataMigrationEnvironment(); }); Console.WriteLine("0"); await application.InitializeAsync(); Console.WriteLine("1"); await application .ServiceProvider .GetRequiredService<CapDbMigrationService>() .MigrateAsync(); Console.WriteLine("2"); await application.ShutdownAsync(); Console.WriteLine("3"); _hostApplicationLifetime.StopApplication(); Console.WriteLine("DbMigrator finished."); }
It does not reach
Console.WriteLine("1");
. Now it comes to abp internals of which I have no idea. Maybe this helps? -
0
I think this is related to the
AbpLicenceCode
-
0
You were right. I solved it.
AbpLicenceCode
inappsettings.secrets.json
was not read in, because we added custom code to read in appsettings from different environments, which did not read in the secrets file since we did not need it before.Now that the DbMigrator has the Licence Code, it does not crash anymore.
Maybe a suggestion: There should be an error message thrown, its really confusing and inconvenient if the program silently crashes.
Thank you for your help @liangshiwei
-
0
Okay, great to hear that the problem was solved.