Search code examples
visual-studio-2010entity-frameworkenumsvisual-studio-2012compatibility

Opening a MVC4 EF5 project created in VS 2012 in 2010


I created a project in the express edition of VS 2012, it was MVC4 using EF5 Model First with enums. I get this error when trying to run the same project now in VS 2010.

Error 1 Error 5: The element 'Schema' in namespace 'http://schemas.microsoft.com/ado/2008/09/edm' has invalid child element 'EnumType' in namespace 'http://schemas.microsoft.com/ado/2008/09/edm'. List of possible elements expected: 'Using, Association, ComplexType, EntityType, Function, EntityContainer' in namespace 'http://schemas.microsoft.com/ado/2008/09/edm' as well as any element in namespace '##other'.

It seems VS2010 does not support enums? But I have checked the EF version being used and it is still v5... so I am confused.

Any ideas?


Solution

  • Entity framework will reference 4.4 when you're targeting .NET 4.0 with vs 2010.

    The 4.4 comes from the assembly version of EntityFramework.dll when you install EntityFramework 5.0 into a project that targets .NET Framework 4.0. This is merely a side effect of how the runtime loads and binds to assemblies, and in no way reflects the version of the product.

    for more information check There is no such thing as Entity Framework 4.4

    Compatibility

    Some features are only available when writing an application that targets .NET 4.5. This includes enum support, spatial data types, table-valued functions and the performance improvements. If you are targeting .NET 4.0 you still get all the bug fixes and other minor improvements.

    For more information check EF5 Release under compatibility section.

    I hope this will help to you.