30 June 2017

'DbContextOptionsBuilder' does not contain a definition for 'UseSqlServer'

When you try to connect to SQL Server database using Entity Framework and you got the following error message:

'DbContextOptionsBuilder' does not contain a definition for 'UseSqlServer' and no extension method 'UseSqlServer' accepting a first argument of type 'DbContextOptionsBuilder' could be found .....

A simple way to get around with this error is to simply add or install a NuGet package Microsoft.Entityframeworkcore.Sqlserver

No comments:

Post a Comment