I'm using NuGet 2.8.50506.491
. I created a couple of C#
projects with custom Microsoft Build tasks and helper functions. There is a targets file. It looks something like this.
<package >
<metadata>
<id>$id$</id>
<version>$version$</version>
<title>MyTasks</title>
<authors>Werner Strydom</authors>
<owners>Werner Strydom</owners>
<licenseUrl>http://example.org/LICENSE</licenseUrl>
<projectUrl>http://example.org/</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Sample tasks.</description>
<releaseNotes>Initial Release</releaseNotes>
<copyright>Copyright 2014 Werner Strydom</copyright>
</metadata>
<files>
<file src="MyTasks.targets" target="build/net40" />
<file src="bin\$configuration$\*.dll" target="build/net40" />
<file src="bin\$configuration$\*.pdb" target="build/net40" />
</files>
</package>
In the Visual Studio project files, I set the BuildPackage
property to true
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{96535580-0000-0000-0000-2843D7EC2767}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MyTasks</RootNamespace>
<AssemblyName>MyTasks</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<BuildPackage Condition="'$(BuildPackage)' == ''">true</BuildPackage>
</PropertyGroup>
When I built the project, a nupkg
is created. I changed the extension to zip
and looked at the contents of the file. The outputs of the project is in the lib/net40
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.
How do I prevent the project outputs from ending up in the lib folder?