首先安装用NuGet
最近重装win8就装上vs2012来做一个mvc3的项目,哪知在创建项目的时候就遇到如下错误:
错误: 此模板尝试加载组件程序集 “NuGet.VisualStudio.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”。有关此问题和如何启用此模板的详细信息,请参见有关“自定义项目模板”的文档。
查了资料才明白VS2012已经全面切换到使用NuGet这个第三方开源工具来管理项目包和引用模块了,使用VS2012开发,都要装NuGet插件(官网:http://nuget.org),进官网点安装就进入了微软的下载页面,虽然是第三方工具,但是相比JQuery与微软貌似有更近的关系。至于什么关系就先不研究了,进微软下载页面可以下载到NuGet.Tools.vsix文件,双击安装就可以了。也可以通过VS2012的“工具-扩展和更新-联机”安装“NuGet Package Manager”扩展包即可解决了。很容易找到,就在第一个。
再利用NuGet更新entity framework是出现
“This package (or one of its dependencies) contains an init.ps1 file and need.."的错误
后来在网上看了篇文章http://blog.sharechiwai.com/2012/05/this-package-or-one-of-its-dependencies-contains-an-init-ps1-file-and-needs-to-be-installed-from-the-package-manager-console/,按着里面的配置来做可以了
當我嘗試使用NuGet來更新EntityFramework的Reference 時出現了以下的錯誤信息…
“This package (or one of its dependencies) contains an init.ps1 file and needs to be installed from the Package Manager Console.”
說要使用Package Manager Console 才可以進行安裝..
由於我對NuGet不知熟識…
所以便要花一些時候來做Research 看看怎樣使用NuGet的 Package Manager Console.
解決方法:
原來Package Manager Console 應該是在Visual Studio 左下方的分頁上的
如果找不到的話可以用以下的方法開啟
“Tools” ->”Library Package Manager” -> 選擇 “Package Manager Console”
開啟之後可以在Console上輸入以下指令來安裝Entity Framework的更新
Install-Package EntityFramework
Update Entity Framework Completed
Hope you find it useful