The term 'Update-Database' is not recognized as the name of a cmdlet

前端 未结 26 938
无人共我
无人共我 2020-12-07 19:35

I am using EF5 beta1 and while I was able to run the \"Update-Database\" before. Now that I shut down Visual Studio, I cannot get it to run. I get the following error:

26条回答
  •  眼角桃花
    2020-12-07 20:08

    Sometimes when I load VS, I see this in my package manager console:

    Value cannot be null.

    Parameter name: path1

    I have no idea what causes that yet but it seems that something goes wrong during the start-up of the Powershell console which interrupts the registering of specific modules, such as the EF powershell extensions. You can just manually load it however:

    Import-Module .\packages\EntityFramework.6.1.1\tools\EntityFramework.psm1
    

    Make sure you replace 6.1.1 with whatever your current version of Entity Framework is.

提交回复
热议问题