[英]Package Manager Console Enable-Migrations CommandNotFoundException in visual studio pro s2017
I tried to run the command 'Enable-Migrations' in the microsoft sample project https://docs.microsoft.com/en-us/ef/ef6/modeling/code-first/migrations/ with visual studio professional 2017, But I got the message:我尝试使用 Visual Studio Professional 2017 在 microsoft 示例项目https://docs.microsoft.com/en-us/ef/ef6/modeling/code-first/migrations/中运行命令“Enable-Migrations”,但我得到消息:
PM> Enable-Migrations
The term 'Enable-Migrations' 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, verif
y that the path is correct and try again.
At line:1 char:18
+ Enable-Migrations <<<<
+ CategoryInfo : ObjectNotFound: (Enable-Migrations:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
1、I have tried the re-starting Visual Studio and re-install EntityFramework Packages using "Install-Package EntityFramework -IncludePrerelease" but these are invalid
2、I have tried upgrade my powershell to 4.9.3.5777, but it is also invalid
3、I have tried Import-Module ProjectPath\packages\EntityFramework.6.3.0\tools\EntityFramework6.psd1,but invalid
BTW,I am using EntityFramework6.3.0.顺便说一句,我正在使用 EntityFramework6.3.0。
Did you install:你安装了吗:
Install-Package EntityFramework
I resloved the question by installing EntityFramework5.0 with .net Framework4.5.我通过使用 .net Framework4.5 安装 EntityFramework5.0 解决了这个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.