Search code examples
nugetnuget-packagenuget-spec

Copy files from a subfolder to root in nuspec


I'm trying to copy a bunch of files from a specific folder into the root of a nuget package. Here's how it looks in my nuspec file:

<files>
  <file src="dist/product1/**/*.*" />
</files>

I want the files under dist/product1 be copied to root of nuget package but instead all files go to dist/product1 folder in nuget file, meaning it preserves the folder structure. I tried many variations. Any ideas?


Solution

  • Using NuGet Package Explorer, I found out that I can use the following syntax.

    <files>
      <file src="dist\product1\**\*.*" target="" />
    </files>