Using <files> element and Folder Conventions

Dec 15, 2010 at 8:56 PM

I was giving a presentation on NuGet ( and I stupidly made a last minute change to one of my demos. I should know better by now, but I wanted to show something extra. I had the following folder layout:


My nuspec looked something like this:

<?xml version="1.0"?>
<package xmlns:xsd="" xmlns:xsi="">
  <metadata xmlns="">
    <!-- SNIP -->
    <file src="bin\debug\*.dll" target="lib" />
When I created the package, I noticed that the Content was not in the package. At first, I thought it was a bug. But then I realized this might be by design, but I can't remember. Did we make a conscious decision that if you specify the <files> element, you are now in charge of specifying everything that goes in the package and we ignore the convention? The more I think about it, that makes total sense and I'll update the documentation with that.

Dec 15, 2010 at 8:58 PM

I can't find the thread, but I thought that was the intention. Once you specify <files>, you take ownership for what files are included. Otherwise, there's no way to opt-out of the automatic behavior. I certainly hope that was intended!

Dec 15, 2010 at 9:44 PM
That is the thread as I remember.
Dec 15, 2010 at 10:07 PM

Yes that's the behavior.

Dec 15, 2010 at 10:11 PM

Yep. I had a momentary amnesia while giving a demo. I updated the docs to be more clear about that. Thanks!