1

当我添加代码生成项时,我收到此错误:

尝试安装“EntityFramework”的“5.0.0”版本,但该项目已包含不同的版本。跳过...

我该如何解决?

4

2 回答 2

7

尝试在包管理器控制台中执行命令,希望对您有所帮助:

卸载包EntityFramework -Force

它强制卸载具有依赖项的包,并在卸载后执行:

安装包EntityFramework

于 2012-11-09T06:34:29.970 回答
0

谢谢,在阅读了很多其他答案之后,这几个简单的步骤实际上对我有用。

PM> Uninstall-Package EntityFramework -Force
Removing 'EntityFramework 5.0.0' from XXXXX.
Successfully removed 'EntityFramework 5.0.0' from XXXXX.
Uninstalling 'EntityFramework 5.0.0'.
Successfully uninstalled 'EntityFramework 5.0.0'.

PM> Install-Package EntityFramework
Installing 'EntityFramework 5.0.0'.
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'.
Adding 'EntityFramework 5.0.0' to XXXXX.
Successfully added 'EntityFramework 5.0.0' to XXXXX.

Before this I had tried the following but without success: 1. Removed the existing reference to EntityFramework, but couldn't add a new reference. 2. Researched if EntityFramework needs to downloaded and installed differently.

Thankfully I didn't follow some other posts about installing the CTP 5. I already have .net 4.5 and VS Express for the web installed. No other installation was required.

Disclaimer: I am a beginner, so my answer may not be entirely correct.

于 2013-08-10T22:28:01.830 回答