Creating package referencing other packages?

Jul 2, 2011 at 4:36 PM

I've created my first NuGet package now, but am unsure of how to set up a package that depends on other NuGet packages. Sure, I add them to the dependencies list in the nuspec, but what else? Specifically,

 1. Do I include the DLL files of the dependencies in the package?

 2. In the VS solution for the library, SHOULD or MUST I use NuGet to reference these dependencies?

 3. How do I tell NuGet how to add project references to these dependencies in the target solution? Say, I have sample projects under the content/ dir in the package, how do I indicate that these should all (or some of them) references one or more dependencies?


Jul 5, 2011 at 5:42 PM

Can anyone help here please? I am not very clear on what to do at all...

Jul 5, 2011 at 5:48 PM

A bit confused about your 3rd bullet - does your package contain sample projects that need NuGet dependencies?

Jul 5, 2011 at 5:54 PM
When you create a dependency to a package, that is all you need to do.
1. Do NOT, I repeat, do NOT include dependent dlls in your package. When they are in the nuspec as dependencies they will be brought down and referenced appropriately
2. Not a coupling factor. IOW, you can reference them in your solution however you want (unless you are using nuget pack csproj, then it absolutely matters).
3. If I understand what you are asking, look at my answer to #1. They will be referenced automatically.

Jul 5, 2011 at 10:35 PM

Thanks for the reply, I think things are clear now. Glad that there's no exact requirement on NuGet for dependencies in my lib.