Build failed in ASP.NET Boilerplate when connect with PostgreSQL

26 views Asked by At

I use the ASP.NET Boilerplate template version 9.x and .NET 8 but when using the "Add-Migration" template I get the error "doesn't reference Microsoft.EntityFrameworkCore.Design. This package is required for the Entity Framework Core Tools to work. Ensure your startup project is correct, install the package, and try again.". At that time, I updated the packages to the latest version and performed "Add-Migration" but got the error "Build Failed". When running the command, I adjusted DefaultProject to EntityFrameworkCore

I use PostgreSQL edited the []DbContextConfigurer configuration to

public static void Configure(DbContextOptionsBuilder<[]DbContext> builder, string connectionString)
{
     builder.UseNpgsql(connectionString);
}

public static void Configure(DbContextOptionsBuilder<[]DbContext> builder, DbConnection connection)
{
     builder.UseNpgsql(connection);
}
0

There are 0 answers