title: How to create a NuGet package with MSBuild tasks and a targets file
body: <p>I'm using <code>NuGet 2.8.50506.491</code>. I created a couple of <code>C#</code> projects with custom Microsoft Build tasks and helper functions. There is a targets file. It looks something like this.  </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;package &gt;
    &lt;metadata&gt;
      &lt;id&gt;$id$&lt;/id&gt;
      &lt;version&gt;$version$&lt;/version&gt;
      &lt;title&gt;MyTasks&lt;/title&gt;
      &lt;authors&gt;Werner Strydom&lt;/authors&gt;
      &lt;owners&gt;Werner Strydom&lt;/owners&gt;
      &lt;licenseUrl&gt;http://example.org/LICENSE&lt;/licenseUrl&gt;
      &lt;projectUrl&gt;http://example.org/&lt;/projectUrl&gt;
      &lt;requireLicenseAcceptance&gt;false&lt;/requireLicenseAcceptance&gt;
      &lt;description&gt;Sample tasks.&lt;/description&gt;
      &lt;releaseNotes&gt;Initial Release&lt;/releaseNotes&gt;
      &lt;copyright&gt;Copyright 2014 Werner Strydom&lt;/copyright&gt;
    &lt;/metadata&gt;
    &lt;files&gt;
      &lt;file src="MyTasks.targets" target="build/net40" /&gt;
      &lt;file src="bin\$configuration$\*.dll" target="build/net40" /&gt;
      &lt;file src="bin\$configuration$\*.pdb" target="build/net40" /&gt;
    &lt;/files&gt;
  &lt;/package&gt;
  </code></pre>
  
  <p>In the Visual Studio project files, I set the <code>BuildPackage</code> property to <code>true</code></p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;PropertyGroup&gt;
      &lt;Configuration Condition=" '$(Configuration)' == '' "&gt;Debug&lt;/Configuration&gt;
      &lt;Platform Condition=" '$(Platform)' == '' "&gt;AnyCPU&lt;/Platform&gt;
      &lt;ProjectGuid&gt;{96535580-0000-0000-0000-2843D7EC2767}&lt;/ProjectGuid&gt;
      &lt;OutputType&gt;Library&lt;/OutputType&gt;
      &lt;AppDesignerFolder&gt;Properties&lt;/AppDesignerFolder&gt;
      &lt;RootNamespace&gt;MyTasks&lt;/RootNamespace&gt;
      &lt;AssemblyName&gt;MyTasks&lt;/AssemblyName&gt;
      &lt;TargetFrameworkVersion&gt;v4.0&lt;/TargetFrameworkVersion&gt;
      &lt;FileAlignment&gt;512&lt;/FileAlignment&gt;
      &lt;BuildPackage Condition="'$(BuildPackage)' == ''"&gt;true&lt;/BuildPackage&gt;
  &lt;/PropertyGroup&gt;
  </code></pre>
  
  <p>When I built the project, a <code>nupkg</code> is created. I changed the extension to <code>zip</code> and looked at the contents of the file.  The outputs of the project is in the <code>lib/net40</code> folder. So when I add this package to another project, it also adds references to those assemblies, which is not desired, since this package is purely for used for builds.  </p>
  
  <p>How do I prevent the project outputs from ending up in the lib folder?  </p>