脚手架控制器不与Visual Studio 2013更新3和4的工作 [英] Scaffolding controller doesn't work with visual studio 2013 update 3 and 4

查看:224
本文介绍了脚手架控制器不与Visual Studio 2013更新3和4的工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

林无法在Visual Studio 2013年脚手架控制器(MVC5控制器与意见,使用实体框架)(更新3和4)。该错误消息如下:

Im unable to scaffold a controller (MVC5 Controller with views, using Entity Framework) in Visual studio 2013 (update 3 and 4). The error message is below:

有正在运行选中的代码生成一个错误:

There was an error running the selected code generator:

A configuration for type 'Library.Morthwind.Models.Catgeory' has already been added. To reference the existing configuration use the Entity<T>() or ComplexType<T>() methods



我已经从'实体框架电动工具Beta 4的工具菜单中选择逆向工程代码第一次'创建的模型。

I have created the models by selecting 'Reverse Engineer Code First' from the 'Entity Framework Power Tools Beta 4' Tool menu.

任何关于什么可能导致这个错误的想法?

Any ideas about what might cause this error?

推荐答案

今天我有同样的问题。

I had the same issue today.

我已经增加了一些自定义的配置为我的模型类之一添加使用流畅API的关系。

I had added some custom configuration for one of my Model classes to add a relationship using the fluent API. This was specified in my dbContext class in the OnModelCreating override using the following:

modelBuilder.Configurations.Add(new OrderConfiguration());



注释掉上述行允许的控制器脚手架按预期运行。

VS 2013更新2过这个问题,脚手架想出了,没有进一步的信息,无益的错误。在已安装的更新3,它给了刚刚足够的细节来追查潜在的问题。

VS 2013 update 2 had a problem with this and the scaffolding came up with an unhelpful error with no further information. In installed Update 3 and it gave just enough detail to track down the underlying issue.

杰夫。

这篇关于脚手架控制器不与Visual Studio 2013更新3和4的工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆