Aktivity „O_SAG“

Thank you, it works now. I must have confused the packages.

You were right. I solved it. AbpLicenceCode in appsettings.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

Further investigations:

  • dotnet build works without issues
  • The error occures in await application.InitializeAsync(); in StartAsync() in DbMigratorHostedService.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?

You can try configure the appsettings.secrets.json

Thanks, but this is already implemented like you suggested. I'm not sure appsettings.secrets.json is even the problem :(

I figured it out - I had to remove these two Packages from the .csproj File:

<PackageReference Include="Volo.Abp.Account.Application" Version="8.0.3" />
<PackageReference Include="Volo.Abp.Account.HttpApi" Version="8.0.3" />

Thank you.

Zobrazených 1 až 5 z 5 záznamov
Made with ❤️ on ABP v8.2.0-preview Updated on marca 25, 2024, 15:11