Installing Entity Framework 4.2 in VS2010

两盒软妹~` 提交于 2020-01-07 02:03:15

问题


Entity Framework templates and menu items generate errors in Visual Studio 2010 Ultimate on 64-bit XP.

The "Reverse Engineer Code First" menu item in Visual Studio tells me that version 4.0.0.0 of System.Data.Entity.dll cannot be found in the GAC, as do the item templates.

I have run the 4.1 msi, and the 4.2 nuget. As a result I have versions of the dll in the following 7 locations:

  • Windows\Microsoft.NET\Framework\v4.0.30319\
  • Windows\Microsoft.NET\Framework64\v4.0.30319\
  • Windows\Microsoft.NET\assembly\GAC_MSIL\policy.4.0.system.data.entity\v4.0_0.0.0__b77a5c561934e089\
  • Program Files\Reference Assemblies\Microsoft\Framework\v3.5\
  • Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\
  • Program Files (x86)\Reference Assemblies\Microsoft.NetFramework\v4.0\
  • Program Files (x86)\Reference Assemblies\Microsoft.NetFramework\v4.0\Profile\Client\

Anyone have any suggestions? Seems to me "Microsoft's recommended data access technology for new applications" should not be so difficult to install.


回答1:


Entity framework 4.0 (System.Data.Entity.dll) is part of .NET 4.0. There is no separate download. EF 4.1 ad EF 4.2 are distribution of EntityFramework.dll (not System.Data.Entity.dll). EF 4.2 is only distributed as NuGet and is not installed to GAC.

Reverse Engineer Code First is not part of any of these tools. It is part of EF Power Tools CTP 1 which is most probably dependent on EF 4.1 (it was released prior to EF 4.2 and there is possibility that it doesn't work with EF 4.2). This tool itself has no relation to functionality of Entity framework.




回答2:


Install EF6 or so using the nuget command line tool. Then in youe msvs solution explorer Add Reference, Browse to the C:\Workplace\C:\Workplace\EntityFramework.6.1.3\lib\net45 then add the .dll, either *SQLEntityFramework.dll or *EntityFramework.dll file.



来源:https://stackoverflow.com/questions/8054790/installing-entity-framework-4-2-in-vs2010

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