How to fix 'DbContextOptionsBuilder' does not contain a definition for 'UseSqlServer'
By FoxLearn 2/18/2024 9:44:24 AM 65
This post shows you how to fix 'DbContextOptionsBuilder' does not contain a definition for 'UseSqlServer' and no accessible extension method 'UseSqlServer'.
Error
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?)
To solve the problem you can right click on your project, then select Manage Nuget Packages, finally install it to your ASP.Net Core project,
PM > Install-Package Microsoft.EntityFrameworkCore.SqlServer
- ASP.NET Core: How to Create RDLC Report in ASP.NET Core
- How to fix Assets file 'project.assets.json' not found
- How to fix 'IMvcBuilder' does not contain a definition for 'AddNewtonsoftJson'
- How to set cookie ValidationInterval in ASP.NET Core
- How to fix LoginPath not working in ASP.NET Core
- How to fix Unable to resolve service for type 'Microsoft.AspNetCore.Identity.UserManager'
- How to Configure ASP.NET Core Identity password policy
- How to fix System.InvalidOperationException: Scheme already exists: Identity.Application
Categories
Popular Posts
Visual Studio: Auto increment version
04/01/2024
What is ARM architecture?
04/01/2024
What Are RESTful Web Services?
02/19/2024