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

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

这就是它的全部功能

相关文章

这篇文章主要讲解了“WPF如何实现带筛选功能的DataGrid”,文...
本篇内容介绍了“基于WPF如何实现3D画廊动画效果”的有关知识...
Some samples are below for ASP.Net web form controls:(fr...
问题描述: 对于未定义为 System.String 的列,唯一有效的值...
最近用到了CalendarExtender,结果不知道为什么发生了错位,...
ASP.NET 2.0 page lifecyle ASP.NET 2.0 event sequence cha...