Search code examples
nugetteamcitynuget-packagenuspecnuget-spec

.dot-prefixed directories in NuGet packages?


Currently I have a bunch of files living in a directory under TFS. Essentially I want to make a NuGet package out of it in my build server.

I do want however to move the file structure into a sub-directory and re-base from there. Let me explain:

The TFS path watched is: $/Foo/Bar/

$/Foo/Bar/
│
│   Bar.nuspec
│
└───PackageContent/
    │   GenPumpGraphCtrl.dll
    │   MultiPumpCurve.dll
    │   PumpGraphCtrl2.dll
    │
    ├───Dwg/
    │       Logofnt1.wmf
    │       LOGOFNT1a.wmf
    │       LOGOFNT1b.wmf
    │
    ├───Ref/
    │       AqSolutions.xbn
    │       Astring.bin
    │       WordTranslation.xbn
    │
    └───Temp/
        │   
        └───Notes/
                Notes.txt

My .nuspec uses:

  <files>
    <file src="PackageContent\**"/>
  </files>

However, I want to rename the PackageContent directory to .package-content and updated my .nuspec:

  <files>
    <file src=".package-content\**"/>
  </files>

But by NuGet Pack step in TeamCity complains with the following error:

>> Cannot create a package that has no dependencies nor content.
  1. Are .dot-prefixed directories somewhat hidden from TFS?
  2. Are .dot-prefixed directories automatically ignored by the some obscure rule in the .nuspec?

Further investigation into the problem shows that in fact, if I place any .dot-prefixed directory, it gets entirely excluded from my NuGet package, despite using a wildcard.

The question is clearer now: How can I ensure I really include everything? Including .dot-prefixed directories?


Solution

  • Ok, in fact there is this obscure -NoDefaultExcludes parameter for nuget pack.

    In my case, I had to add it to the Command line parameters box for the TeamCity NuGet Pack step:

    enter image description here