AddDbContext中缺少UseSqlServer [英] UseSqlServer missing from AddDbContext

查看:543
本文介绍了AddDbContext中缺少UseSqlServer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只需升级到asp.net core 2.1, AddDbContext 的选项中似乎不再存在 UseSqlServer . (我在其中输入连接字符串的地方)

Just upgraded to asp.net core 2.1 and it seems like UseSqlServer no longer exists in the options for AddDbContext. (where I pass in the connectionstring)

我应该用什么代替?

推荐答案

添加了nuget包 Microsoft.EntityFrameworkCore.SqlServer ,并且再次起作用

Added nuget package Microsoft.EntityFrameworkCore.SqlServer and it worked again

这篇关于AddDbContext中缺少UseSqlServer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆