'packages.config' files are excluded from packages created by Octopack


Thanks for a great product. I’ve really been enjoying using it up to now. Unfortunately we’ve been having some problems lately with a few newly added file that are not included in the output from Octopack. I could fix this for some file types by setting the following msbuild option:


This does not help for including files called packages.config, however. This is a problem for us since the CMS we’re using (EPiServer) uses files with that name under the App_Data\Modules folder to register what plugins are installed. Thus we really want to include it, but when I read the source code for Octopack it seems that all such files are excluded regardless of their location (https://github.com/OctopusDeploy/OctoPack/blob/master/source/OctoPack.Tasks/CreateOctoPackPackage.cs#L162).

What’s the reason for this behaviour and how can avoid this exclusion for our project?

Thanks in advance,


Hi Emil,

Thanks for getting in touch. You’re right, we exclude packages.config explicitly - we do this because that file causes all kinds of problems for NuGet. However we may only need to exclude it at the root - I’d have to check.

For now, you can add it to the <files> section of your NuSpec, then use /p:OctoPackEnforceAddingFiles=true to have OctoPack add all the default files it would normally add, plus whatever is in your <files> element.


Hi Paul,

Thank you, that worked perfectly so I’m happy for now :slight_smile: