Nuget: How do I recreate my package directory using packages.config
I have installed StructureMap using Nuget.
I do not want to checkin the created packages directory.
H开发者_如何学Goow do I recreate my package directory using packages.config
?
I tried Update-Package
with no success (nothing happended, I only get a little delay for the first time).
My packages.config:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="structuremap" version="2.6.3" />
</packages>
See this article on the NuGet website: Using NuGet without committing packages to source control.
The article shows how to setup NuGet to restore all required packages for a solution. This NuGet feature is called "NuGet Package Restore".
I know you've approved an answer but I thought I'd share what I did.
In VS2010 I went to Tool->Library Package Manager > Package Manager Console in the Console I typed this command
PM> Install-Package NuGetPowerTools
Then I typed this
PM> Enable-PackageRestore
This put a folder called .nuget at the top level of my solution
In that folder I created a file called restore.bat with this as the content
cd ..
for /f "tokens=* delims=" %%i in ('dir /s /b packages.config') do (
.nuget\nuget.exe install -o packages "%%i"
)
cd .nuget
running the bat file will do a full reinstall of all the stuff in your package files
To finish off the job I made a solution folder in my project called .nuget and included the bat file and other junk that was in there just so another developer getting my project doesn't have to think too hard.
Lol... surprisingly, when I replaced the package.config file into my new solution from old one, and started Package Manager Console, it automatically guessed it and gave me a button if I wanted to restore all the packages. I just clicked it and voila! It's all done. I'm using Visual Studio 2012. Hope, it helps somebody. thanks!
精彩评论