entity-framework – 术语’scaffold-dbcontext’不被识别为cmdlet,函数,脚本文件或可操作程序的名称

当尝试使用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”中可以使用它.

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

这就是它的全部功能

相关文章

### 创建一个gRPC服务项目(grpc服务端)和一个 webapi项目(...
一、SiganlR 使用的协议类型 1.websocket即时通讯协议 2.Ser...
.Net 6 WebApi 项目 在Linux系统上 打包成Docker镜像,发布为...
一、 PD简介PowerDesigner 是一个集所有现代建模技术于一身的...
一、存储过程 存储过程就像数据库中运行的方法(函数) 优点:...
一、Ueditor的下载 1、百度编辑器下载地址:http://ueditor....