I am upgrading some unit tests I had written in .net core 2.2 to .net core 3.1. The following is part of my code:

var sqlLiteDataSource = $"Data Source={_databaseFile}";
var retailerDbContextOptions = new DbContextOptionsBuilder<RetailerDatabaseContext>().UseSqlite(sqlLiteDataSource).Options;

using (var _db = new RetailerDatabaseContext(retailerDbContextOptions))
{
     _db.Database.EnsureCreated();
}

There seems to be some assemblies removed in the new version of .net core that causes the last line to throw the following error:

Could not load type `Microsoft.EntityFrameworkCore.RelationalReferenceCollectionBuilderExtensions` from assembly `Microsoft.EntityFrameworkCore.Relational`

Any idea how I can fix this?

0

There are 0 best solutions below