public BuildResult BuildProject(string directoryPath, IBenchmarkLogger logger)
 {
     string projectFileName = Path.Combine(directoryPath, MainClassName + ".csproj");
     var consoleLogger = new MSBuildConsoleLogger(logger);
     var globalProperties = new Dictionary<string, string>();
     var buildRequest = new BuildRequestData(projectFileName, globalProperties, null, new[] { "Build" }, null);
     var buildParameters = new BuildParameters(new ProjectCollection()) { DetailedSummary = false, Loggers = new ILogger[] { consoleLogger } };
     var buildResult = BuildManager.DefaultBuildManager.Build(buildParameters, buildRequest);
     return buildResult;
 }
 public BenchmarkBuildResult Build(BenchmarkGenerateResult generateResult)
 {
     var projectFileName = Path.Combine(generateResult.DirectoryPath, BenchmarkClassicGenerator.MainClassName + ".csproj");
     var consoleLogger = new MSBuildConsoleLogger(logger);
     var globalProperties = new Dictionary<string, string>();
     var buildRequest = new BuildRequestData(projectFileName, globalProperties, null, new[] { "Build" }, null);
     var buildParameters = new BuildParameters(new ProjectCollection()) { DetailedSummary = false, Loggers = new ILogger[] { consoleLogger } };
     var buildResult = BuildManager.DefaultBuildManager.Build(buildParameters, buildRequest);
     return new BenchmarkBuildResult(generateResult, buildResult.OverallResult == BuildResultCode.Success, buildResult.Exception);
 }