How to exclude config files in Nuget package

Hi,

Is there any way to exclude some config or any other files from the Nuget packages by using Octo.exe?if so kindly specify how to do it.

Thanks,
Murali Prasad

Hi Murali,

Thanks for getting in touch! You can exclude files from the package right at packaging time using Nuget’s File-Exclude tag. On this link you can find an example of this:

Let us know if this helps you achieve what you were trying to do :slight_smile:

Dalmiro

Hi Dalmiro,

Thanks for replying…

But in our project we are not using any “.nuspec” , we are using Octo.exe commands to pack and Nuget.exe command to push the packages. My code will look likes the following,

C:\Users\build.company\Desktop\OctopusTools.2.5.10.39\Octo.exe pack --basePath="C:\BuildServer\Builds\Proj\Dev1\Dev\Attor" --outFolder=C:\DO1\Attor --id=Attor --overwrite 600 C:\Users\build.company\Desktop\nuget.exe push C:\DO1\Attorneyroo\Attor.2014.*.nupkg -ApiKey API-RTJTPVGGILLSP50HUIMCA4KJW8 -source http://172.xx.xxx.xx:85/nuget/packages

In this kindly let me know where i have to use exclude command as i tried in all places but no use.

Thanks,
Murali Prasad

Hi Dalmiro,

Thanks for replying…

Actually we are not using any “.nuspec” files in our Build, we are using “Octo.exe” command to pack the packages and “Nuget.exe” to push those packages.
So, in this kindly let me know where i have to use excutable task ASAP as i tried with several ways but no use.

Thanks,
Murali Prasad

Hi Murali,

The “Pack” command on “Octo.exe” does come in handy when you want to pack exactly what you have on your folder. But when you need to do something a bit more complicated, like excluding some files, you will need to use “Nuget.exe” with a Nuspec file. You could add the nuspec file to your code’s source control and still use it on an executable task.

dalmiro