在Visual Studio 2013的.edmx生成EF6问题 [英] Issues Generating .edmx EF6 in Visual Studio 2013

查看:388
本文介绍了在Visual Studio 2013的.edmx生成EF6问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为我的数据库我的EDMX文件在Visual Studio 2013对任何一个MSSQL 2012年或2008数据库服务器和表集。该EDMX文件生成带有了问题,一切看起来很正常,直到我尝试编译该项目。 。代表一个数据库表错误出在以下消息的每一个对象

I am trying to generate my edmx file for my database in Visual Studio 2013 against either a mssql 2012 or 2008 database server and table set. The edmx file generates with out issue, and everything looks fine until i try to compile the project. Every single object representing a database table errors out with the following messages.


  1. 系统使用命名空间指令只能应用于命名空间; 系统是一种没有命名空间

  2. 类型名称'集合'不会在类型'Model.blah.System'存在

  1. A using namespace directive can only be applied to namespaces; 'System' is a type not a namespace
  2. The type name 'Collections' does not exist in the type 'Model.blah.System'

类型名称日期时间不会在类型'Model.blah.System'存在

The type name 'DateTime' does not exist in the type 'Model.blah.System'

using语句被正确定位所产生的代码命名空间声明中,就像所有其他的.edmx EF文件,我在过去已经看到了。

The using statements are correctly located inside the generated codes name space declaration, just like all other EF .edmx files i have seen in the past.

该错误信息是所有数据库对象全线一致。无论我做什么我如何生成我EDMX模型是无用的,无法使用。

The error messages are consistent across the board for all database objects. NO matter what i do how i generate the my edmx model it is useless and not usable.

我与Visual Studio运行2013年更新2我一直在使用EF5并试图EF6无济于事。我需要一些帮助搞清楚为什么我的生活我无法正确生成我的EF模型。

I am running with Visual Studio 2013 Update 2. I have tried using EF5 and EF6 to no avail. I need some help figuring out why for the life of me i can't correctly generate my EF model.

推荐答案

我想猜你有一个命名空间冲突,在那里,因为你定义的系统类,它是模糊的编译器失败系统命名空间。

I'd guess that you have a namespace collision, where the compiler fails because you defined a System class that is ambiguous with the System namespace.

重命名系统类别的东西来解决你的问题。

Rename your System class to something else to solve your problem.

这篇关于在Visual Studio 2013的.edmx生成EF6问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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