I want to exclude files in the subfolders

My folder structure
Applications-Tools-Ajax- [all dlls]
ThirdParty-Devexpress- [all dlls ]
ThirdParty-Telerik- [all dlls ]

My Nuspec structure

I want to exclude all the files in the Application and ThirdParty folders.
No need to package these two folders, However, I need to package all the other website related files.
I have tried with /p:OctoPackEnforceAddingFiles=true but it includes the above-mentioned folders with all the files.


Thanks for getting in touch! Unfortunately I can’t think of any way to achive this with .nuspec files whilst also keeping the built-in OctoPack conventions around packaging the right files.

Are the files in those folders marked as “Content” or “Copy to output directory”? Would it be possible to disable them if so?

Otherwise you might need to look into a manual publishing process:

  1. Use MSBuild to publish the web application to a folder
  2. Use PowerShell to delete the file paths that you want to exclude from that published folder
  3. Use Octo.exe pack to package the folder

Hope this helps,

Paul Stovell

Thanks Paul.

Thanks, Paul.

I reckon you should consider adding this feature to Octopus.
It is notoriously difficult to remove any third party DLLs or other similar settings from the Octo package.

“nuspec exclude” could have significantly helped to reduce the size of the package, especially in these scenarios. If it would be available as a feature.