In our solution we have a configuration file that is named something like this -
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 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?
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?
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
Thanks for the quick response.
What we pass to MS Build Argument is something like this -
If I am correct this will change to -
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?
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.
This worked for us and there were no extra files in the nuget package.
Thanks for all your help!