MVC3安装EntityFramework5

利用NuGet添加EntityFramework引用时出现This package (or one of its dependencies) contains an init.ps1 file and need to be installed from the Package Manager Console,不能安装

  在使用MVC3建立站点的时候,需要引入EFCodeFirst,但是引入后发现这个东西已经过期了,MVC3中已经不能用了,提示说“Code First is now available as part of the 'EntityFramework' package.”。添加了System.Data.Entity引用(using System.Data.Entity),还是找不到DbContext类。于是,我就去装EntityFramework这货,想不到安装的时候出问题了,提示“This package (or one of its dependencies) contains an init.ps1 file and need to be installed from the Package Manager Console.”,如下图:

 

MVC3安装EntityFramework5_第1张图片

 

  这货的意思大概是说要用Package Manager Console方法安装才行,仔细找找,还真有这东西——关掉上边的窗口,选择“工具-Library Package Manager-Package Manageer Console”

 

MVC3安装EntityFramework5_第2张图片

 

开启之后可以在Console上输入以下指令来安装Entity Framework的更新
Install-Package EntityFramework
 
 *注意选择你要安装的项目 Default project

 在PM>的后面输入上面的命令,回车……Install-Package EntityFramework安装成功!如下图:

 

 

 

你可能感兴趣的:(framework)