我已经按照Npsql网站上的所有说明安装和运行带有.NET Entity Framework Core的PostGIS,但是一旦该应用开始运行,我将收到以下异常:
Could not load type 'GeoAPI.NetTopologySuiteBootstrapper' from assembly 'NetTopologySuite, Version=2.0.0.0, Culture=neutral, PublicKeyToken=f580a05016ebada1'.
public class SpatialDbContext : DbContext
{
public DbSet<TouristAttraction> TouristAttractions { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder builder)
{
builder.UseNpgsql(@"Connection", o => o.UseNetTopologySuite());
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.HasPostgresExtension("postgis");
}
}