Hi @saleh salem,
Your package reference seems to be correct. The error you're encountering indicates that the UseSqlServer
method is not being recognized by the DbContextOptionsBuilder
. This method is part of the Microsoft.EntityFrameworkCore.SqlServer
package.
- Try to manually remove all the
Bin
andObj
directories in the projects. And thepackage
and.vs
directories, if you have them. - Then right-click the project to clean and rebuild the project.
- If still not working, try to install the two packages again by using Nuget Package Manager or run command in Package Manager Console like below:
Install-Package Microsoft.EntityFrameworkCore.SqlServer
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best regards,
Rena