Can I avoid checking in the bin folder of the MVC3 project using NuGet?

I created an MVC3 project and pulled out several libraries using NuGet (NHibernate, AutoFac, etc.). It seems that these libraries are configured to install binaries in the bin folder and not to reference the root packages folder. When I pulled out the sources on another machine (the beep folder was not in the original control yet), I had a bunch of broken links.

Question: Am I doing something wrong? Is there a way to set this so that I don't have to check the binary folder without having to use the GAC or manually manage the link back to the packages folder?

I am using VS2010 sp1 and NuGet 1.4.

UPDATE

I found my problem! I migrated the project after it was created and the libraries were downloaded via NuGet. This worked fine on my first developer machine, because I already had a dll in my bin folder, but it didn’t work on my second dev machine, because the <HintPath> in the .csproj file no longer indicated the correct packages folder.

To fix this, upload the project to VS, edit it and correct the links. It would be nice if NuGet checked the <HintPath> parameter in the .csproj file and automatically adjusted it.

NuGet work item: http://nuget.codeplex.com/workitem/1230

+4
source share
2 answers

My solution is to put nuget.exe in the solution folder that I installed in the source control and use pre -build for each project:

 "$(SolutionDir)NuGetCLI\nuget" install "$(ProjectDir)packages.config" -o "$(SolutionDir)Packages" 

This pulls out and sets up packages used in the project. The advantage is that I do not need to store binaries at all in the source control.

+2
source

Am I doing something wrong?

In fact, when you install a NuGet package containing assemblies, there is a packages folder created in the root of the project. This folder contains all files for all installed packages. Then links are created from this folder. Therefore, do not forget to check this folder and its contents in version control. This folder is not automatically added to the Visual Studio project, so I do not know what VCS you are using, but it does not seem to support this folder.

0
source

All Articles