nuget package that adds files to another package

Jun 19, 2011 at 1:03 AM

I would like to create a Nuget package that adds to the package contents of another package.  Can this be done, and can anyone point me to an example?

Specifically, I have a NUnit addon I want to create a nuget package for.  It will have a dependency on the NUnit package.  The NUnit package includes a test runner at path packages\NUnit.\tools.  I'd like my nuget package to add some files at path packages\NUnit.\tools\addins.  (this allows the test runner at tools to find the addin)

Jun 19, 2011 at 4:08 AM

There is no direct support for this, but I suspect you could do it using an install.ps1 script, which would copy the file in the right place. The hard part is to find exactly where to copy the file to. You should not hard code the exact NUnit version, as your package may end up getting installed against a newer version (unlike you ask for an exact version dependency, which is best avoided).

Others may have more specific advice and code samples to point you to.