C930363716 2018-10-23 08:37 采纳率: 0%
浏览 1101

dotnetcore 连接字符串卸载startup中 无法执行dotnet ef migrations add命令

如题,如果连接字符串写在startup中提示:

System.InvalidOperationException: No database provider has been configured for this DbContext. A provider can be configured by overriding the DbContext.OnConfiguring method or by using AddDbContext on the application service provider. If AddDbContext is used, then also ensure that your DbContext type accepts a DbContextOptions<TContext> object in its constructor and passes it to the base constructor for DbContext.

如果将连接字符串写在 context中是可以执行的.

项目结构图:图片说明

  • 写在StartUp中的截图:图片说明图片说明
  • 写在Context中的截图:图片说明
  • 写回答

1条回答 默认 最新

  • devmiao 2018-10-26 07:08
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 matlab有关常微分方程的问题求解决
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?
  • ¥100 求三轴之间相互配合画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable