.NET Core EF 脚手架抛出无法找到提供程序程序集 'Source=localhost'
.NET Core EF Scaffolding throws unable to find provider assembly 'Source=localhost'
我正在使用 core 3 并且我在我的项目中包含了以下包
"Microsoft.EntityFrameworkCore.Design": "5.0.7",
"Microsoft.EntityFrameworkCore.SqlServer": "5.0.7",
"Microsoft.EntityFrameworkCore.Tools": ""5.0.7""
这是我的连接字符串,我之前测试过连接并且成功了
"ConnectionStrings": { "bikeStore": "Data Source=localhost;Initial Catalog=BikeStore;User ID=sa;Password=***********" }
现在我想运行脚手架命令如下
Scaffold-DbContext Data Source=localhost;Initial Catalog=BikeStore;User ID=sa;Password=***********Microsoft.EntityFrameworkCore.SqlServer -OutputDir Data
我遇到了以下错误
Build started...
Build succeeded.
Unable to find provider assembly 'Source=localhost'. Ensure the name is correct and it's referenced by the project.
这是服务器资源管理器以及我如何连接到我的数据库
我的方法有什么问题?
您可以将 Data Source
替换为 Server
并提供提供商标志:
Scaffold-DbContext -Connection "Server=localhost;Initial Catalog=BikeStore;User ID=sa;Password=***********;" -Provider Microsoft.EntityFrameworkCore.SqlServer -OutputDir Data
我正在使用 core 3 并且我在我的项目中包含了以下包
"Microsoft.EntityFrameworkCore.Design": "5.0.7",
"Microsoft.EntityFrameworkCore.SqlServer": "5.0.7",
"Microsoft.EntityFrameworkCore.Tools": ""5.0.7""
这是我的连接字符串,我之前测试过连接并且成功了
"ConnectionStrings": { "bikeStore": "Data Source=localhost;Initial Catalog=BikeStore;User ID=sa;Password=***********" }
现在我想运行脚手架命令如下
Scaffold-DbContext Data Source=localhost;Initial Catalog=BikeStore;User ID=sa;Password=***********Microsoft.EntityFrameworkCore.SqlServer -OutputDir Data
我遇到了以下错误
Build started...
Build succeeded.
Unable to find provider assembly 'Source=localhost'. Ensure the name is correct and it's referenced by the project.
这是服务器资源管理器以及我如何连接到我的数据库
我的方法有什么问题?
您可以将 Data Source
替换为 Server
并提供提供商标志:
Scaffold-DbContext -Connection "Server=localhost;Initial Catalog=BikeStore;User ID=sa;Password=***********;" -Provider Microsoft.EntityFrameworkCore.SqlServer -OutputDir Data