Nuspec add ability to not overwrite files in a csproj


I had a project that I wanted to include dynamically generated files that couldn't be explicitly added to the project. When using msdeploy we overrode the CopyAllFilesToSingleFolderForPackageDependsOn in the csproj. When we switched to nuget we had to add a nuspec like
    <file src="*.aspx" />
    <file src="*.ashx" />
    <file src="*.config" />
    <file src="*.ps1" />
    <file src="bin\**\*.dll" target="bin" />
    <file src="..\..\deploy\*.*" target="Updates" />
But since <files> overwrites what would be packaged in the csproj, we now have to maintain another list of things being added to the project.

I would expect to write something more like this
  <files InAdditionToProject="true">
    <file src="..\..\deploy\*.*" target="Updates" />
Closed May 27, 2014 at 11:58 PM by RanjiniM
As per customer's comment


jeff_winn wrote May 27, 2014 at 2:51 AM

This really depends on how you're creating the package. If you're building a package using a csproj file and have your nuspec file located next to the csproj file (I name the nuspec the same as the project name), it will pick up the list of files in addition to the compiled output of your project automagically.

You simply need to use: nuget.exe pack My.csproj

roguesith wrote May 27, 2014 at 5:22 PM

You're right. This was happening on an old version. I verified the expected behavior using an updated nuget command line utility. This issue can be closed.

Thank you