你先在一台能联网的电脑上装NuGet,并且在一个临时项目上下载安装EF5, 然后在这个临时项目文件夹中就可以找到.nupkg 文件, (或在NuGet的Package Manager中浏览Package Cache找到刚才下载的EF5), 然后在你的开发机上安装NuGet, 把它的Feed设为本地( 如何让Nuget读取你本地的feed见如下链接: http://docs.nuget.org/docs/creating-packages/hosting-your-own-nuget-feeds ), 然后把.nupkg文件拷到你开发机中设定的feed文件夹中, 这样在开发机上就可以像联网一样使用NuGet了.
What if you can’t connect to the Internet from your development machine. Or what if you are not allowed to install NuGet on your machine. Don’t worry; all is not lost.
First you need to get the NuGet package. For this you do need to be able to connect to the Internet from some machine—but it doesn’t have to be your development machine. You’re reading this so presumably you’re not completely off-the-grid. :-)
You can get the package by using NuGet in Visual Studio on a machine connected to the Internet in the normal way—just install the package you want into a dummy project. After installing the package you can find the .nupkg file either in the dummy project folder or by browsing the Package Cache from the Package Manager Settings menu option.
You can also get the package without Visual Studio by using NuGet.exe.
If you are able to install NuGet on your development machine then do so and setup a local feed. This may sound daunting but it’s really easy. Copy the .nupkg file to your local feed and then use NuGet to install it in the normal way—with no connection to the Internet required.
If you can’t install NuGet on your development machine then take the .nupkg file and rename it to .zip—yep, it’s a zip file. You can now extract EntityFramework.dll from the zip file and use it as you would any other assembly. Note that you will not get any of the automatic project-level integration I mentioned above, so you may have to do more manual configuration of your project.