EDMX .NET 4.5 to 4.0?

c# edmx edmx-designer entity-framework

Question

We're using the Entity Framework and we created our EDMX when our project was set to build .NET 4.5. Now we want to switch to .NET 4.0 but when we do, we get compilation errors for the EDMX file.

It states the following error:

Error 10027: The XML namespace for the conceptual model's schema element is not supported on this project's target framework version.

Is there any solution other than recreating the EDMX file?

1
4
9/10/2013 4:01:06 PM

Accepted Answer

Assuming you don't use features that shipped with .NET Framework 4.5 (enums, spatial types, stored procs with multiple result sets) you can do the following (be sure to back the file up just in case):

  • Create a new console app targeting .NET Framework 4.5
  • Add the edmx file to the project
  • Retarget the project to target .NET Framework 4 (go to project properties, change target framework version)

This should result in downgrading your edmx to v2.

Alternatively you could manually change xml namespaces and versions to v2. You can find what namespace to use for each version of the artifact here:

Edit Note that with EF6/EF6.x you can use Edmx v3 on .NET Framework 4 and therefore get all the goodnes (like enums) that was before only available on .NET Framework 4.5

4
5/5/2014 2:23:23 AM

Popular Answer

Note for those on VS 2012 there is a separate install that's required if you want to keep a .Net 4 project on edmx v3. Entity Framework 6 Tools for Visual Studio 2012 – Jeff Jan 27 at 2:09

The above comment from Pawel's answer fixed my problem. I am copying it out into its own answer so that people can find it.



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