Enable-Migrations - Cannot bind argument to parameter 'Path'

前端 未结 7 1607
青春惊慌失措
青春惊慌失措 2020-12-20 18:34

I\'m new to ASP.NET and am trying to set up a webAPI c# application with entity framework. But when I try to run the Enable-Migrations command on nuget-package-manager conso

相关标签:
7条回答
  • 2020-12-20 18:39

    I had this error when using EntityFramework 6.3.0, downgrading it to 6.2.0 fix my issue.

    0 讨论(0)
  • 2020-12-20 18:43

    There is a workaround for this bug. Just edit a file and restart Visual Studio. It works!

    0 讨论(0)
  • 2020-12-20 18:48

    Issue is due to not having sufficient privileges to run the command. Open Visual studio in administrator mode (Run as Administrator) and execute the command.

    0 讨论(0)
  • 2020-12-20 18:57

    I had same error and just update EF to latest version (Here to 6.4.0) Now migrations works well.

    update-package entityframework
    enable-migrations
    Add-Migration InitialCreate
    
    0 讨论(0)
  • 2020-12-20 18:57

    I get this if I have my database code in a separate class library. To get the commands to work I had to select the class library as the start up project.

    So I did the following...

    Select the project where the database context exists and right click, select "Set as StartUp Project".

    Select the default project as the correct project.

    Ensure that you are in the project directory on the filesystem.

    Run the commands.

    0 讨论(0)
  • 2020-12-20 19:02

    Just use any of the versions of EntityFramework except 6.3.0. In my case using EntityFramework 6.0.0 solved the problem.

    0 讨论(0)
提交回复
热议问题