0

I'm currently learning Entity Framework (code-first approach).

  1. I have created a POCO entity
  2. Created a context class that inherits from DbContext and it exposes DbSet properties for the types that I want to use to be part of the model
  3. In the PowerShell command window inside Visual Studio, I tried:

    PM> enable-migrations
    

Running this command is throwing an error:

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 <<<<
+ CategoryInfo : ObjectNotFound: (enable-migrations:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

I don't know why this happening..

I already tried :

  • Restart Visual Studio
  • Install and reinstall EF
  • Restarting Visual Studio with administrator privilege.

enter image description here

Tay
  • 300
  • 2
  • 12
  • Have you tried "Enable-Migrations"? Maybe it's case sensitive. – Federico Rossi Feb 23 '20 at 23:13
  • Yes @FedericoRossi but no same error is showing up – Tay Feb 23 '20 at 23:15
  • Does this answer your question? [Package Manager Console Enable-Migrations CommandNotFoundException only in a specific VS project](https://stackoverflow.com/questions/10411529/package-manager-console-enable-migrations-commandnotfoundexception-only-in-a-spe) – Hamed Moghadasi Feb 24 '20 at 05:13
  • @HamedMoghadasi actually I dont know why my thread was closed..!! I had read that thread and all the upvoted answer I had tried by myself but no still i am getting the same error, again and again – Tay Feb 26 '20 at 21:38

0 Answers0