Including files not part of csproj

Hi Paul,

is there any way to include files not referenced by the csproj-file?

I’m using require.js and r.js to minify my javascript files in a build step in team city, but I don’t want to have the minifed file as a part of the csproj.

Hi Jon,

Not currently, you would need to consider using a custom task that calls NuGet.exe pack directly. It’s becoming clear that we need a way to specify additional files to include, though, so I’ll try to find a way to accommodate this in a future release.


Hi Paul,

I’m facing the exact same issue, trying to pull in some external files as part of a TC build step. In terms of a way to do this, could this be achieved by allowing a parameter to switch the behaviour of the files section in the .nuspec file? E.g.


which would allow the default behaviour of octopack to run first and copy those files specified in the nuspec afterwards?

In the meantime, my current plan is to build a separate .nupkg in TC for assets and then use a separate step in Octo to deploy before/after the website is deployed and then use powershell to move the files around. Is this what you were thinking with the custom call NuGet.exe, or were you thinking along different lines?


Hi Richard,

My thoughts were more to use a script that gathers all the files you need into a single folder. E.g.,:

copy all content files to Foo\
copy all DLL's to Foo\
copy some other files to Foo\
copy a nuspec file to Foo\
cd Foo\
nuget.exe pack .... 

I’ll try to add this capability to a future OctoPack release though to make it easier.


Any updates on this? We are facing with same issue…


Thanks for reaching out. You can use Octopack with a custom nuspec file and the OctoPackEnforceAddingFiles msbuild parameter

More info about this:



yup, use octopack, please see screenshot to example.