Add NuGet Packages Folder to Solution File?
Asked Answered
K

4

31

Nuget puts the package in my root folder(in my case my trunk folder). I am wondering is there a way to let VS 2010 know about this folder? I am using ankh svn to do my commuting so it would be really nice to have it in my solution so when I add a reference I can commit it from VS 2010 and not have to go to my trunk and manually do it.

Can this be done?

Kapok answered 24/1, 2011 at 0:32 Comment(0)
L
10

The easiest way to do this currently is by using the Working Copy Explorer (View -> Working Copy Explorer). From here you can browse your solution folder, and add the reference.

I added the idea to enhance this to the AnkhSVN feedback forum, please go vote :-)

Lael answered 27/1, 2011 at 22:24 Comment(3)
this will work fine, the issue is that you have to manual do it and when you add other packages you need to do it again. When in a team the other developers will no have the files pulled from source control automatically. So for a single dev i would agree with answer.Expertise
@SimonThompson That's not true, adding it is manual, but only needs to be done by one person that adds the reference. The rest is automatic.Lael
This answer is obsolete. Be sure to check out Leniel Macaferi's answer for the preferred method.Professional
P
23

You may be interested in reading this NuGet doc:

Using NuGet without committing packages to source control

Patrol answered 8/2, 2012 at 4:25 Comment(4)
Yep. Been using this since it came out. Happy they came up with this solution as it is even better than committing the .dlls.Kapok
Brilliant answer. Just what I was looking for! :)Ambassadoratlarge
That's very nice. Does that still work if the build is done by NAnt?Pokelogan
@daveL Unfortunately I don't know if this is possible with NAnt. You'd better ask another question here on StackOverflow (mentioning this one)... I'm sure someone versed with NAnt will reply. :)Patrol
L
10

The easiest way to do this currently is by using the Working Copy Explorer (View -> Working Copy Explorer). From here you can browse your solution folder, and add the reference.

I added the idea to enhance this to the AnkhSVN feedback forum, please go vote :-)

Lael answered 27/1, 2011 at 22:24 Comment(3)
this will work fine, the issue is that you have to manual do it and when you add other packages you need to do it again. When in a team the other developers will no have the files pulled from source control automatically. So for a single dev i would agree with answer.Expertise
@SimonThompson That's not true, adding it is manual, but only needs to be done by one person that adds the reference. The rest is automatic.Lael
This answer is obsolete. Be sure to check out Leniel Macaferi's answer for the preferred method.Professional
I
9

You should consider 'don't commit packages workflow'. It is much more mature solution:

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

Izzy answered 20/9, 2011 at 9:56 Comment(2)
I think this is now made obsolete by Leniel Macaferi's answer.Anibalanica
true, but the question dates back to 2011, when there wa no such a mechanism :)Izzy
E
7

You can add the packages directory as a web project. I use TFS so the only issue is after adding a package I need to include these files to the source control but at least there visible...

Expertise answered 23/4, 2011 at 9:30 Comment(2)
Agree should be an official way , it's like they forgot :-)Expertise
I got build errors initially doing this. Remember to remove the "web site" from the list of projects to build. Then works like a charm.Vodka

© 2022 - 2024 — McMap. All rights reserved.