Im trying to follow a Entity Framework Core video in a .NET Core 2.1 DAL class library. In the DbContext.OnCofiguring the following code is placed :
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
base.OnConfiguring(optionsBuilder);
optionsBuilder.UseSqlServer("Server*.");
}
The problem is that the UseSQLServer is missing? From this its suggested to add Microsoft.EntityFrameworkCore.SqlServer nuget. When doing this I get some version conflicts that I dont know how to solve :
Severity Code Description Project File Line Suppression State Error CS1061 'DbContextOptionsBuilder' does not contain a definition for 'UseSqlServer' and no accessible extension method 'UseSqlServer' accepting a first argument of type 'DbContextOptionsBuilder' could be found (are you missing a using directive or an assembly reference?) DataAccessLayer
--
Severity Code Description Project File Line Suppression State Error Package restore failed. Rolling back package changes for 'DataAccessLayer'.
--
Severity Code Description Project File Line Suppression State Error NU1605 Detected package downgrade: Microsoft.Extensions.Configuration from 2.2.0 to 2.1.1. Reference the package directly from the project to select a different version.
DataAccessLayer -> Microsoft.EntityFrameworkCore.SqlServer 2.2.3 -> Microsoft.EntityFrameworkCore.Relational 2.2.3 -> Microsoft.EntityFrameworkCore 2.2.3 -> Microsoft.Extensions.Logging 2.2.0 -> Microsoft.Extensions.Configuration.Binder 2.2.0 -> Microsoft.Extensions.Configuration (>= 2.2.0) DataAccessLayer -> Microsoft.Extensions.Configuration (>= 2.1.1) DataAccessLayer
--
Severity Code Description Project File Line Suppression State Error NU1605 Detected package downgrade: Microsoft.Extensions.DependencyInjection from 2.2.0 to 2.1.1. Reference the package directly from the project to select a different version. DataAccessLayer -> Microsoft.EntityFrameworkCore.SqlServer 2.2.3 -> Microsoft.EntityFrameworkCore.Relational 2.2.3 -> Microsoft.EntityFrameworkCore 2.2.3 -> Microsoft.Extensions.DependencyInjection (>= 2.2.0) DataAccessLayer -> Microsoft.Extensions.DependencyInjection (>= 2.1.1) DataAccessLayer
--
I suspect that the project is using a couple of nuget packages and some of them is referencing a diffrent version of another nuget or dll.
It suggest to reference a package direcly? Does this mean that I should reference a dll manually? Where do I get the dll from?