Issues Generating .edmx EF6 in Visual Studio 2013

c# entity-framework-6

Question

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. 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'

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

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.

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.

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.

1
4
9/18/2014 10:22:00 PM

Popular Answer

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.

8
9/18/2014 10:24:38 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow