Using <files> element and Folder Conventions

Coordinator
Dec 15, 2010 at 9:56 PM

I was giving a presentation on NuGet (http://www.c4mvc.net/) 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:

/routedebugger
    /bin/debug/RouteDebugger.dll
    /content/SomeFile.txt

My nuspec looked something like this:

<?xml version="1.0"?>
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
    <id>routedebugger</id>
    <version>1.0.0</version>
    <!-- SNIP -->
  </metadata>
  <files>
    <file src="bin\debug\*.dll" target="lib" />
  </files>
</package>
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 9: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 10:44 PM
That is the thread as I remember.
Developer
Dec 15, 2010 at 11:07 PM

Yes that's the behavior.

Coordinator
Dec 15, 2010 at 11:11 PM

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

Phil