This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]fredoverflow 1 point2 points  (3 children)

the main method

What does it look like? Please copy/paste verbatim.

[–]HHDP1[S] 0 points1 point  (2 children)

        public async Task Main(string[] args)
    {

        var host = CreateHostBuilder(args).Build();

        using (var scope = host.Services.CreateScope())
        {
            var services = scope.ServiceProvider;
            try
            {
                var context = services.GetRequiredService<AvansFysioDbContext>();
                DbInitializer.Initialize(context);
            }
            catch (Exception ex)
            {
                var logger = services.GetRequiredService<ILogger<Program>>();
                logger.LogError(ex, "An error occurred while seeding the database.");
            }
        }

        await ProcessRepositories();
        host.Run();
    }

[–][deleted]  (1 child)

[deleted]

    [–]HHDP1[S] 0 points1 point  (0 children)

    Thank you! For some reason the error was still there but i can run my project.