今天在将项目升级到asp.net core6.0后发现报错A relational store has been configured without specifying either the DbConnection or connection string to use.

项目使用的数据库是MySQL,由于版本跨度太大,应该是新版本方法有改变,我原来的旧版本还是.net core2.1呢.发现要两个参数才能正确运行,具体代码

NET6报错A relational store has been configured without specifying either the DbConnection or connection string to use connection

 builder.Services.AddEntityFrameworkMySql().AddDbContext<MysqlContext>(options => options.UseMySql(MysqlContext.ConnectionString, ServerVersion.AutoDetect(MysqlContext.ConnectionString)));

以上就是【NET6报错A relational store has been configured without specifying either the DbConnection or connection string to use】的全部内容了,欢迎留言评论进行交流!

赞(0) 踩(0)

与本文相关的软件

发表我的评论

最新评论

  1. 暂无评论