带有 Visual Studio 11 Beta .Net 4.5 的 Edmx 文件 [英] Edmx file with Visual Studio 11 Beta .Net 4.5

查看:35
本文介绍了带有 Visual Studio 11 Beta .Net 4.5 的 Edmx 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 Visual Studio 2011 测试版创建新的 edmx 文件时遇到问题

I am having trouble creating a new edmx file using Visual Studio 2011 beta

  • 目标框架 .Net 4.5
  • 类库项目

添加空模型后,出现以下错误

After adding an empty model I get the error below

错误 6039:警告 CS1701:假设程序集引用'System.Data.Entity,版本=4.0.0.0,文化=中性,PublicKeyToken=b77a5c561934e089' 匹配 'System.Data.Entity,版本=4.2.0.0,文化=中性,PublicKeyToken=b77a5c561934e089',您可能需要提供运行时策略 fjwflppr.0.cs(465,29) :错误CS1061:System.Data.Metadata.Edm.EdmFunction"不包含'IsComposableAttribute' 的定义并且没有扩展方法'IsComposableAttribute' 接受类型的第一个参数可以找到System.Data.Metadata.Edm.EdmFunction"(您是否错过了using 指令或程序集引用?)

Error 6039: warning CS1701: Assuming assembly reference 'System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' matches 'System.Data.Entity, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089', you may need to supply runtime policy fjwflppr.0.cs(465,29) : error CS1061: 'System.Data.Metadata.Edm.EdmFunction' does not contain a definition for 'IsComposableAttribute' and no extension method 'IsComposableAttribute' accepting a first argument of type 'System.Data.Metadata.Edm.EdmFunction' could be found (are you missing a using directive or an assembly reference?)

未找到方法:'布尔值System.Data.Metadata.Edm.EdmFunction.get_IsComposableAttribute()'.

Method not found: 'Boolean System.Data.Metadata.Edm.EdmFunction.get_IsComposableAttribute()'.

根据 msdn EdmFunction.IsComposableAttribute 仅在 .net 4.5 中受支持,并且项目默认引用 C:Program Files (x86)Reference AssembliesMicrosoftFramework.NETFramework 中的 dllv4.5System.Data.Entity.dll 但 vs 中的文件属性窗口显示 4.0.0.0

According to msdn EdmFunction.IsComposableAttribute is only supported in .net 4.5 and the project by default references the dll from C:Program Files (x86)Reference AssembliesMicrosoftFramework.NETFrameworkv4.5System.Data.Entity.dll but the file Properties window in vs is showing 4.0.0.0

我对我的项目应该参考哪个版本的 System.Data.Entity.dll 以使 edmx 设计器工作感到困惑.

I am confused about which version of System.Data.Entity.dll my project should reference to get the edmx designer to work.

推荐答案

问题是因为 EF CTP 卸载没有清除所有文件,它留下了一个绑定到旧版本4.2.0.0"的策略文件,所以 VS 会一直寻找那个旧版本.

The issue was because the EF CTP uninstall didn't clean all files, it left a policy file which had binding to the old version "4.2.0.0", so VS will always look for that old version.

详情在此https://stackoverflow.com/a/9665596/1261784

这篇关于带有 Visual Studio 11 Beta .Net 4.5 的 Edmx 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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