Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am working on MVC3 application. I use entity framework, NInject, Fluent Validation and some more Nuget packages. I am using Tortoise SVN for versioning.

Recently I changed the structure of my SVN repository, so my working copy of MVC3 app was moved to some different folder in the repository.

Now when I checked out the copy from SVN, all the references that I had added through Nuget were lost(EF, NInject and rest nuget packages were showing yellow missing icon in references). This had happened to me prior to this also, when I tried to check out the app from svn to some other folder. I had to manually add all the references again through Nuget again. Am I doing anything wrong?

Please guide. I hope I could explain my problem properly.

share|improve this question

closed as off topic by Jim G., Walter, gnat, Robert Harvey, thorsten müller Dec 3 '12 at 13:09

Questions on Programmers Stack Exchange are expected to relate to software development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

add comment

2 Answers

up vote 2 down vote accepted

Are you checking in the NuGet packages to SVN?

If you are you might want to consider using package restore, which will pull down any missing NuGet packages on build.

From the package manager console.

Install-Package NuGetPowerTools 
Enable-PackageRestore 

Then you just need to check in the contents of the newly created .nuget folder.

Then anytime you checkout to another directory, you just need to build to get the packages needed for your project.

Reference http://blog.davidebbo.com/2011/08/easy-way-to-set-up-nuget-to-restore.html

share|improve this answer
    
No, I am not checking in Nuget Packages to SVN. I am checking in just the package.config file. Will try this solution. Thanks for the answer. –  Pravin Patil Apr 5 '12 at 10:02
    
If you are not checking in the packages and you haven't done PackageRestore then that explains why you are missing the references when you check out a copy of the repository. –  Chris Diver Apr 5 '12 at 11:19
add comment

Lucky for you, you don't have to commit the libraries/packages in your sourcecontrol system anymore. Davit Ebbo has written a nice blogpost about this 'new' feature.

To sum it up, you only have to commit the package.config. Once you have done so, you can install all the libraries/packages with this command:

X:\MySolutionInANewFolder>nuget i MySolution\packages.config -o Packages

This will install all the packages from the package.config in the Packages folder, which lives beneath the solution folder.

I needed to do this task myself, today, so I've tried it out. It appears the commandline tool used in the blogpost doesn't work properly on my machine. Lucky for us, the NuGet team has created something called 'NuGet Package Restore' functionality. I'm trying it out right now, but it has timed out. Hopefully it will work soonish.

Last edit:

The combination of both seemed to do the trick.

First, click the 'NuGet Package Restore' option on the solution file. (make sure you don't have too much solutions loaded, otherwise it'll time out (internal server error 500).

Second, run the command nuget i ..\YourProjectFolder\packages.config -o ..\Packages from the new .nuget folder. Your packages will get installed in the Packages folder on the same level as YourProjectFolder. This has worked for me now.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.