Skip to content

Instantly share code, notes, and snippets.

@dougrathbone
Created March 19, 2013 02:00
Show Gist options
  • Save dougrathbone/5193097 to your computer and use it in GitHub Desktop.
Save dougrathbone/5193097 to your computer and use it in GitHub Desktop.
MsBuild through the c# api
var pc = new ProjectCollection();
var buildProperties = new Dictionary<string, string>
{
{"Configuration", "Release"},
{"Platform", "Any CPU"},
{"OutputPath", _outputPath},
{"EnableNuGetPackageRestore", "true"}
};
var buildParameters = new BuildParameters(pc);
buildParameters.Loggers = new List<ILogger>{ new CustomMSBuildLogger(_inputPath)};
var buildRequest = new BuildRequestData("myProject.csproj", buildProperties, null, new[] { "Clean", "Rebuild" }, null);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment