加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

entity-framework – 术语’scaffold-dbcontext’不被识别为cmdl

发布时间:2020-12-16 04:15:19 所属栏目:asp.Net 来源:网络整理
导读:当尝试使用asp.net核心这个命令进行脚手架时 scaffold-dbcontext “Data Source=(local);Initial Catalog=MyDb;Integrated Security=True;” Microsoft.EntityFrameworkCore.sqlserver -outputdir Models 给出了这个错误. scaffold-dbcontext : The term ‘s
当尝试使用asp.net核心这个命令进行脚手架时

scaffold-dbcontext “Data Source=(local);Initial
Catalog=MyDb;Integrated Security=True;”
Microsoft.EntityFrameworkCore.sqlserver -outputdir Models

给出了这个错误.

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
+ scaffold-dbcontext “Data Source=(local);Initial Catalog=MyDB;In …
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (scaffold-dbcontext:String) [],CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

我尝试过解决方案here,但它对我不起作用.

知道原因/治疗方法是什么吗?

解决方法

>确保在project.json文件“Microsoft.EntityFrameworkCore.Tools.DotNet”:“1.0.0-preview3-final”中可以使用它.

>在程序包管理器控制台中运行该命令

这就是它的全部功能

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读