0

I'm trying to compose a NuGet package containing my assembly and it's required data files.

What I would like to happen is when the parent project referencing my NuGet package is built, the data files from my package are copied to the output directory of the parent project.

This sounds straight forward but if I flag the data files as content in my package project they're just added to the parent project on install but not automatically copied on build.

I would like to do this with a custom .targets file in my package if possible.

Mark S
  • 47
  • 2
  • 7
  • Possible duplicate of [Set content files to "copy local : always" in a nuget package](http://stackoverflow.com/questions/21143817/set-content-files-to-copy-local-always-in-a-nuget-package) – kjbartel Feb 01 '16 at 00:20
  • See here for a solution: http://stackoverflow.com/a/30316946/1730559 – kjbartel Feb 01 '16 at 00:21

1 Answers1

1

I guess this is answered here

From my experience you can do this only with install.ps1. Modify these files tags - add a <CopyToOutputDirectory>Always</CopyToOutputDirectory> child

You can do it either with plain XML either with NugetPowerTools

Community
  • 1
  • 1
Andrey Ershov
  • 1,773
  • 1
  • 16
  • 26