当你的才华不能撑起你的野心时,就是你该选择学习的时候了!

entity-framework 'scaffold-dbcontext' 未被识别为 cmdlet、函数、脚本文件或可操作程序的名称

// 出现此错
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. At line:1 char:1
//解决办法 包管理器控制台中添加如下几个包
Microsoft.EntityFrameworkCore.Design
Microsoft.EntityFrameworkCore.Tools
Microsoft.EntityFrameworkCore.SqlServer
Scaffold-DbContext -Connection "Server=xxxxxx0001;Database=xxxxxx;Integrated Security=SSPI;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models\DemoDB -force

 

.net core 连接数据库(通过数据库生成Modell) - Royal丶鬼才 - 博客园 (cnblogs.com)

posted @ 2023-10-09 14:48  hofmann  阅读(163)  评论(0)    收藏  举报