Adding content to NuGet packages
05:38 16 Feb 2026

I have a number of binary files that I need to copy to the build output (\bin) folder when I build my WPF desktop project. I can't have them in my Git repo so I decided to wrap them in a NuGet package and publish to our on-premise Azure DevOps server.

I've added the files to the "content" folder of the .nupkg file. Is this the correct approach? After referencing the package in my project, the files then appear in the project's root folder in Solution Explorer. I then have to go into their properties and change "Copy to Output Directory" option to "Copy if newer". Only then will the files get copied to the build output folder when I build.

While this works, I don't like the files "polluting" the project/Solution Explorer, as there are quite a lot of them. Is there a better approach? It seems odd that NuGet first drops them into the project folder (or is this just how it works?), rather than being able to copy the files straight from the NuGet package to the build output folder.

nuget nuget-package