Remove files from Nuget PAckage

Once Octo pack packages we do not want to package the app.config. How can we archive this? Is this possible?

Simple we want to keep the existing app.config in the folder.

Any information would be great thanks.

Go to the properties for app.config in Visual Studio and change Build Action to be None

sorry for misleading what I am actually talking about is the .config which is built at compile time. I don’t think we can exclude this from visual studio.

So what I would like to know is that whether we can pass some parameters and exclude certain files.

Also do you have any samples of the PreDeploy.ps1 and DeployFail.ps1 scripts how we can handle in case of a deploy fail or errors and how to roll back and report via email or loggin.

thanks.

You can use PreDeploy.ps1 to delete any files you dont want to have copied over to the release folder.

eg:
“Remove-Item .\Web.Services.General.config
Remove-Item .\Web.Services.Other.config
Remove-Item .\Web.Elmah.config
Remove-Item .\Web.AppSettings.config”

OR… I forked octopack to check for a octoexcludes.config file and then exclude any files in that list. These will not be pacakged. The reason i did this is we have some 3rd party libs (like Telerik) which change very rarely and I dont need to include an extra 10MB of data in the pacakge.

The code is here - it is a crude hack but works a charm…

– maybe a nice feature to add to the official octo pack?

It is a lot easier to specify excluded files in this way than to create an actual nuspec file which has to explicitly include or exclude files (unless i was doing it wrong)