3

I have a post build event in project which copies a folder that is not included in project to a shared directory in project.

xcopy /Y /E "$(TargetDir)\Views\Shared\CommonScripts" "$(ProjectDir)\Views\Shared\CommonScripts"

Now problem is it works fine If I publish it locally. but If I try to do it using teamcity which is creating a nuget package on build and then publish using octopus. That folder is not included. I try to add it in a nuspec file as follows:-

<files>
<file src="$CommonScriptsSource$" target="$CommonScriptsDestination$" />
</files>

and then defining the prameters in teamcity build parameters but this is also not working. Also please guide how can I make this folder part of a nuget package. or How can I replicate post build event in nuget package.

sam
  • 4,594
  • 12
  • 61
  • 111

2 Answers2

0

By design NuGet excludes some directories (i.e. those starting with a dot).

Try to create a nuget package from commandline on your machine using the nuget pack command and open it with NuGet Package Explorer: it contains the empty directory?

If so you can simply modify the TeamCity build to package your project with that commandline (using a Command Line build step).

Manuel Spezzani
  • 1,041
  • 7
  • 15
0

As mentioned here you can do the following.. How to add a folder to a nuspec file

<files>
  <file src="bin\Release\**\*.*" target="content" /> 
</files>
Community
  • 1
  • 1
Lee Englestone
  • 4,545
  • 13
  • 51
  • 85