本文介绍了应用程序无法脚手架项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了VS 2013专业版的MVC 5应用程序,然后第一次使用EF 6.1 code与SQL Server的防爆preSS现有的数据库。当我尝试创建我使用的是新脚手架项目...,然后选择MVC 5控制器与意见,使用实体框架的意见,我选择模型和上下文类,然后单击确定。然后会出现以下错误消息,并且不会创建任何code。我已经卸载了EF电动工具具有相同的错误。

I created an MVC 5 application in VS 2013 Professional and then used EF 6.1 code first with an existing DB on SQL Server Express. When I try to create the views I’m using the "New scaffolded item…" then selecting the "MVC 5 controller with views, using Entity Framework." I select the model and context classes and click OK. Then the following error message appears and no code is created. I’ve uninstalled EF Power Tools with the same error.

错误

有正在运行的选择code产生一个​​错误:有异常
  被调用的目标引发异常。

我也试着卸载/重新安装VS 2013和SQL Server没有变化。

I've also tried uninstalling/reinstalling VS 2013 and SQL Server with no changes.

什么可能导致这个错误?任何其他的想法。

Any other ideas about what might cause this error?

推荐答案

我有这个问题太,
我通过调用base.onModelCreating在我的数据库方面解决了这个问题。

I had this problem too,I solved the problem by calling the base.onModelCreating in my DB context

base.OnModelCreating(modelBuilder);

这篇关于应用程序无法脚手架项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-10 20:55