How do I place files in the root of a package when using OctoPack?

When I create a nupkg file using OctoPack (without a custom nuspec file), it usually generates a folder structure similar to the following

(root)
  bin
    *.dll
  *.aspx
  web.config

However, I would like to include files under the bin\published folder into the package.
So, I wrote the following nuspec file.

<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
  <metadata>
    <id>$id$</id>
    <version>$version$</version>
    <authors>$authors$</authors>
    <description>$description$</description>
  </metadata>
  <files>
    <file src="bin/publish/**/*" target=""/>
  </files>
</package>

Then, the structure of the nupkg file will look like this.

(root)
  bin
    publish
      bin
        *.dll
      *.aspx
      web.config

How can I place the files under the bin/publish folder directly into the package root, without creating a bin/publish folder in the package, as in the example at the beginning?

Note that in the future I will try to use octo.exe for packaging instead of OctoPack, but for now I can’t start with that.

Thanks.

Hi @aetos,

Thanks for reaching out to Octopus.

Your syntax does look correct for copying files to the root of the package. I am wondering if you have tried backslash \ instead of a forwardslash / to see if that changes the behavior? IE <file src="bin\publish\**\*" target=""/>. I am seeing an external thread here that suggests paths are sometimes treated differently depending on slashes and wildcards.

Please let me know if that helps you get unstuck.

Regards,
Garrett

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.