【发布时间】:2016-10-02 12:58:26
【问题描述】:
ASP.Net Core官方说重启visual studio可以修复如下错误:
Scaffold-DbContext : The term 'Scaffold-DbContext' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
但是命令一直失败。
我按照 ASP.Net 核心在线文档中提供的示例在包管理器控制台中运行它。
Scaffold-DbContext "Server=(localdb)\mssqllocaldb;Database=Blogging;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models
【问题讨论】:
-
请尝试在PowerShell窗口中执行命令(先进入项目文件夹)
标签: c# asp.net-mvc entity-framework