Readdy Write  
0,00 €
Your View Money
Views: Count
Self 20% 0
Your Content 60% 0

Users by Links 0
u1*(Content+Views) 10% 0
Follow-Follower 0
s2*(Income) 5% 0

Count
Followers 0
Login Register as User

DbContextOptionsBuilder does not contain a definition for UseSqlServer and no accessible extension method

28.01.2023 (👁3164)

.Net6: DbContextOptionsBuilder does not contain a definition for 'UseSqlServer' and no accessible extension method

 

Fehlermeldung:

'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?)

 

 

Code Zeile in program.cs

var connectionString = builder.Configuration.GetConnectionString("DefaultConnection");

        builder.Services.AddDbContext<ApplicationDbContext>(options => options.UseSqlServer(connectionString));

 

 

 

Lösung: man muss

Den using Microsoft.EntityFrameworkCore einfügen

Ein Bild, das Text, Screenshot, Monitor, Fernsehen enthält.

Automatisch generierte Beschreibung