Edmx file with Visual Studio 11 Beta .Net 4.5

自古美人都是妖i 提交于 2019-12-21 21:26:36

问题


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

  • Target framework .Net 4.5
  • Class library project

After adding an empty model I get the error below

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

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

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 Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.Entity.dll but the file Properties window in vs is showing 4.0.0.0

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


回答1:


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.

details here https://stackoverflow.com/a/9665596/1261784



来源:https://stackoverflow.com/questions/9652136/edmx-file-with-visual-studio-11-beta-net-4-5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!