我正在尝试从 Visual Studio 2012 中的程序管理器控制台安装最新版本的 EntityFramework。运行 install-package 命令会产生以下错误:
PM> install-package EntityFramework
You are downloading EntityFramework from Microsoft, the license agreement to which is available at http://go.microsoft.com/fwlink/?LinkId=253898&clcid=0x409. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'EntityFramework 5.0.0'.
Successfully uninstalled 'EntityFramework 5.0.0'.
Install failed. Rolling back...
install-package : Failed to add reference to 'System.Data.Entity'. Please make sure that it is in the Global Assembly Cache.
At line:1 char:1
+ install-package EntityFramework
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
因此,我在 Google 上进行了一些探索,并想出了以下内容以输入 Web.Config 文件。我再次尝试使用以下条目安装 EntityFramwork:
<section name="entityFramework" type="EntityFramework.dll, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
这导致了同样的错误。我的问题是:
我怎样才能安装这个包?开箱即用,这应该可以与其他软件包一起使用,这似乎很愚蠢,因为无法快速轻松地安装该软件包。
此软件包的文档以及某种形式的常见问题解答存在于哪里?不存在有关安装问题的文档似乎也很愚蠢。
提前致谢!
::编辑::
我忘了添加我也在 web.config 文件中尝试了以下条目:
<assemblies>
<add assembly="System.Data.Entity, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
...产生了同样的错误。