Entity 6 POCO Code Generation Failing.

Every time my co-worker and I create a new project using EF6 ( Even tried EF5), after I save the .edmx diagram and try to compile I get a ton of errors. One thing that has caught my eye is the fact the using directives are being included after the namespace.

namespace EntityIsCool{ using System; using System.Collections.Generic; }

If I move the directives back to the top, everything is copasetic, otherwise compile error city. I know the C# doesn't care where the using directives are in the code,as I tried to move them around in other classes without issues. It only happens with the POCO generated stuff in EF.

I tried changing the code generation to legacy instead of the T4, but that makes it worse as it cannot find the Dbcontext stuff.

I was able to start up VS2010, create a EF4 project, import it into VS2013 and had zero issues( with EF4). I have the most recent Entity Toolset installed ( 6.1.3), and have tried both EF5 and EF6 code generation. Any help would be great.

by nopcodex90x90 via /r/csharp

Leave a Reply