Skip to content

Instantly share code, notes, and snippets.

@patrickperrone
Created March 28, 2015 17:09
Show Gist options
  • Save patrickperrone/ac4922db06ec2b393de3 to your computer and use it in GitHub Desktop.
Save patrickperrone/ac4922db06ec2b393de3 to your computer and use it in GitHub Desktop.
Enforce "Copy Local = false" for DLL references added by NuGet. This script should be added under the Tools folder.
param($installPath, $toolsPath, $package, $project)
$asms = $package.AssemblyReferences | %{$_.Name}
foreach ($reference in $project.Object.References)
{
if ($asms -contains $reference.Name + ".dll")
{
$reference.CopyLocal = $false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment