Null reference on Entity Framework Migration

前端 未结 2 2093
我寻月下人不归
我寻月下人不归 2020-12-20 16:22

When I user the Add-Migration command of Entity Framework migration I get the following exception:

System.NullReferenceException: Object referen

2条回答
  •  心在旅途
    2020-12-20 17:05

    I've seen this before when there are multiple projects in the solution and the "wrong" project is selected as the startup project. For example, somebody else reported that in an Azure hosted MVC3 website they had the Azure project as the startup project instead of the MVC project. Switching over to the MVC project as the startup fixed the issue.

    Update: This has been fixed in EF5-beta2, which is now available on NuGet.

提交回复
热议问题