EDMX .NET 4.5到4.0吗? [英] EDMX .NET 4.5 to 4.0?

查看:535
本文介绍了EDMX .NET 4.5到4.0吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用实体框架和我们创建了EDMX当我们的项目被设置为构建.NET 4.5。现在我们要切换到.NET 4.0,但是当我们这样做,我们得到的EDMX文件的编译错误

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.

它规定了以下错误:

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



难道还有比重现EDMX文件的其他任何解决方案?

Is there any solution other than recreating the EDMX file?

推荐答案

假设你没有使用随.NET框架4.5附带功能(枚举,空间类型,存储的特效与多个结果集),你可以做以下(确保备份文件了,以防万一):

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):


  • 创建一个新的控制台应用程序针对.NET框架4.5

  • 的EDMX文件添加到项目

  • 将重新指定项目为目标的.NET Framework 4(转到项目属性,改变目标框架版本)

这应导致降级EDMX至V2。

This should result in downgrading your edmx to v2.

另外,您可以手动更改XML命名空间和版本为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:

  • edmx
  • csdl
  • ssdl
  • msl

修改
注意与EF6 / EF6.x你可以在.NET Framework 4的使用EDMX V3,因此让所有的只是前可在.NET框架4.5

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

这篇关于EDMX .NET 4.5到4.0吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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