0

I have the following nuspec file:

<files>
    <file src="..\.BuildScripts\Tools\*.ps1" target="tools" />
    <file src="..\Build\Results\*.*" target="content" exclude="*.txt" />
</files>

when I run NuGet pack project.nuspec, the process completes without any errors, however the tools directory of the created package is empty. When I change the path of the first line to a non-existing path, I do get an error (File not found).

What is wrong with the NuSpec file?

RoelF
  • 7,483
  • 5
  • 44
  • 67

2 Answers2

0

Apparently NuGet does not like dots . in paths. Simply renaming .BuildScripts to BuildScripts solves the problem:

<file src="..\BuildScripts\Tools\*.ps1" target="tools" />

Lesson learned, the hard way!

RoelF
  • 7,483
  • 5
  • 44
  • 67
0

There is a NoDefaultExcludes command line option to nuget pack that overrides this behavior (NuGet Pack Command Options)

hsirah
  • 337
  • 1
  • 10