官方ASP.Net睿說,下面的錯誤可以通過重新啓動Visual Studio的固定:EF核心:腳手架的DbContext不停地進行故障
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核心聯機文檔中提供的示例在Package Manager控制檯中運行它。
Scaffold-DbContext "Server=(localdb)\mssqllocaldb;Database=Blogging;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models
請嘗試在PowerShell窗口中執行命令(首先轉到項目文件夾) –