Skip to content

Instantly share code, notes, and snippets.

@JayBazuzi
Created November 17, 2013 23:02
Show Gist options
  • Save JayBazuzi/7519477 to your computer and use it in GitHub Desktop.
Save JayBazuzi/7519477 to your computer and use it in GitHub Desktop.
An extension method for MSBuild's ProjectRootElement to make adding a UsingTask have less duplication
using System;
using Microsoft.Build.Construction;
public static class ProjectRootElementExtensions
{
public static void AddUsingTask(this ProjectRootElement projectRootElement, Type type)
{
projectRootElement
.AddUsingTask(type.Name, type.Assembly.Location, null);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment