有关实体框架迁移的空参考

有关实体框架迁移的空参考

本文介绍了有关实体框架迁移的空参考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用Entity Framework迁移的Add-Migration命令时,出现以下异常:

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

有见识吗?

推荐答案

在解决方案中有多个项目并且选择了错误"项目作为启动项目之前,我已经看到了这一点.例如,其他人报告说,在Azure托管的MVC3网站中,他们将Azure项目作为启动项目而不是MVC项目.在启动解决问题时切换到MVC项目.

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.

更新:此问题已在EF5-beta2中修复,现在可以在NuGet上使用.

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

这篇关于有关实体框架迁移的空参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 14:27