Home c# Error in EF 6.4 The Term 'Enable-Migrations' Is Not Recognized As The...

Error in EF 6.4 The Term ‘Enable-Migrations’ Is Not Recognized As The Name Of A Cmdlet, Function, Script File, Or Operable Program




Earlier I used the approach Code-First and there was no problem. It was installed version EntityFramework 6.2.0 . The studio offered to update the version 6.4.4 . After updating, I created a new project Win Forms tried to enable migration with the command: enable-migrations , but now it turns out an error:

& gt; 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, Verify That The Path Is Correct and Try Again.
At Line: 1 Char: 18
+ Enable-Migrations & lt; & lt; & lt; & lt;
  + CategoryInfo: ObjectNotFound: (Enable-Migrations: String) [], CommandNotFoundException
  + FullQualifiederrorid: CommandNotFoundException

But if you change the version of EntityFramework Back to 6.2.0 , everything is perfectly created and there is no error. Please tell me who can know what has changed with the new version of EntityFramework , what am I doing wrong?

If you simply close the project, and then start to start with the version Entity 6.4.4 , when you start right away in the console, this is such a mistake:

AT D: \ WindowsFormsApp2 \ Packages \ EntityFramework.6.4.4 \ Tools \ EntityFramework6.ps2.psm1: 241 Char: 5
+ & lt; & lt; & lt; & lt; Warnifotherefs 'Enable-Migrations'
  + CategoryInfo: Parsererror: (:) [], ParentContainSerrorRecordException
  + FullQualifiederrorid: MissingFunctionBody
Import-Module: The Module to Process' EntityFramework6.ps2.psm1 ', Listed in Field' ModuleToprocess' of Module Manifest 'D: \ WindowsForm
SAPP2 \ Packages \ EntityFramework.6.4.4 \ Tools \ EntityFramework6.ps2.psd1 'Was Not Processed Because No Valid Module Was Found in Any Module
AT D: \ WindowsFormsApp2 \ Packages \ EntityFramework.6.4.4 \ Tools \ Init.ps1: 11 Char: 18
+ Import-Module & lt; & lt; & lt; & lt; (Join-Path $ psscriptroot 'entityframework6.ps2.psd1')
  + CategoryInfo: ResourceWorkle: (EntityFramework6.ps2: String) [Import-Module], FileNotFoundException
  + FullyQualifiederrorid: modules_modulefilenotfound, microsoft.powershell.commands.importModulecommand

Answer 1, Authority 100%

In EF Core migrations are included immediately by default and such a command is simply no:


In the EF version 6.3.0, we went to “make it easier to transition to core”

The EF 6.3.0 Runtime Was Released to Nuget in September 2019. The Main Goal of this Release Was To Facilitate Migrating Existing Applications That Use EF 6 to .NET CORE 3.0

and it is possible that they deleted this command in the process of rewriting code:

The Migrations Commands Have Been Rewritten To

PS Full ChangeLog / WhatsNew Here:

https://docs.microsoft.com/en -US / EF / EF6 / What-IS-NEW /

Update: Very similar to this situation:


and the solution how and here the same – rollback by 6.2

In the sense that I need from EF 6 I still need EMDX support and it also lames very much, it is necessary to sharpen your hands in old projects – I see that the bugs in the branch 6.x are rare, reluctantly and all attention on Core .

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions