Tip: EF Command Error

If you are using Entity framework in Visual Studio, you might notice that EF’s cmdlet are not working in nuget console sometimes. It’s because EF module is not loaded in nuget console for some reasons.

Error Message

The term ‘update-database’ is not recognized as the name of a cmdlet, function, script file, or operable program. Che
ck the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:16
+ update-database <<<< -script
+ CategoryInfo : ObjectNotFound: (update-database:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

image001

Solution

You can use the following command to import the EF module.


Import-Module C:\Work\branches\v1\src\packages\EntityFramework.5.0.0\tools\EntityFramework.psd1

3 thoughts on “Tip: EF Command Error

  1. I found here very useful points and I apply these in my project. I would like to say your blog is really a wonderful and full new new information. Thanks a lot for the share with us

  2. Certainly feels more interactive than raising a Chia Pet or the 1970s’ Pet Rock. It’s an “old” title that’s been around since the 2010s (around 2013 and the like). It’s also filled with mini-games galore.

Leave a Reply

Your email address will not be published. Required fields are marked *