Config Files Missing in Nuget Package

Hi,

In our solution we have a configuration file that is named something like this -

.MyApp.Speak.Important.config.

Basically, the name starts with a “.”(dot). This particular file is not getting deployed to the custom deployment directory. This file is not included in the nuget package that is created. I have checked that the content type of this file is “include”.

Could this be an issue with the process of creation of nuget package?

Thanks,
Omkar

Hi Omkar,

Thanks for getting in touch.

How are you creating the nuget package? Using Octopack? Nuget.exe? Octo.exe?

If you remove the dot at the beginning of the file name, does it get added as expected?

Thanks,
Dalmiro

Hi Dalmiro,

Thank you for the response!

Yes, we use TFS build definition with RunOctoPack command in MSBuild Arguments.

If we remove the dot at the beginning, the configuration file gets added as expected.

Is there a known issue/bug with Nuget Package creation such as this?

Thanks,
Omkar

Hi Omkar,

Apparently, avoiding files that start with a dot is a default behavior for nuget, and it has a parameter to bypass that logic: http://stackoverflow.com/questions/13597805/nuget-exe-not-packing-directories-that-start-with-dot

If you want to tell Octopack to pass the -NoDefaultExcludes switch to Nuget.exe, do it using /p:OctoPackNuGetArguments as shown in the Octopack documentation

Best regards,
Dalmiro

Hi Dalmiro,

Thanks for the quick response.

What we pass to MS Build Argument is something like this -

/p:RunOctoPack=true;OctoPackPublishPackageToHttp=http://myserver:8888/Octopus/nuget/packages;OctoPackPublishApiKey=MyApiKey;OctoPackPackageVersion=1.3.0.4

If I am correct this will change to -

/p:RunOctoPack=true;OctoPackPublishPackageToHttp=http://myserver:8888/Octopus/nuget/packages;OctoPackPublishApiKey=MyApiKey;OctoPackPackageVersion=1.3.0.4;OctoPackNuGetArguments=-NoDefaultExcludes

Is that correct?

Also, What might be the repercussions of this change? Will any other files(which are not intended) be included in Nuget Package?

Thanks,
Omkar

Hi Omkar,

I don’t think the parameters need to be separated by semicolons, but other than that it looks ok.

As for the repercussions, I believe that all files that are actually part of your app that start with a “.” will be added. It’ll be a matter of trying it on a test build and see what the package contains after that.

Thanks,
Dalmiro

Hi Dalmiro,

This worked for us and there were no extra files in the nuget package.

Thanks for all your help!
Omkar