Entity Framework code first migrations throwing error

后端 未结 9 1642
再見小時候
再見小時候 2021-02-13 20:17

Here is what I did before I got this error:

  1. Installed EF (the pre release version, 6 maybe, I dunno)
  2. decided I did not want, so uninstalled that and reins
9条回答
  •  北荒
    北荒 (楼主)
    2021-02-13 20:32

    Yes above comment is right that worked for me.

    EntityFramework.dll needed to be in the GAC for Visual Studio to use it from the package manager.

    1. Start Visual Studio Command Prompt (ensure you started Visual Studio as Administrator) 
    2. Go to your packages directory and find the    EntityFramework package directory. 
    3. Go to lib\net45 (if targeting 4.5)    
    4. type: gacutil /i EntityFramework.dll 
    

    Note: It may be wise to restart the computer entirely at this point.

    C:\Windows\system32>cd..
    
    C:\Windows>cd..
    
    C:\>cd \packages\EntityFramework.5.0.0\lib\net45
    
    C:..\packages\EntityFramework.5.0.0\lib\net45>
    gacutil /i EntityFramework.dll
    

    This will definitively works.

提交回复
热议问题