public static void build(string projectFilePath, string outputPath)
{
ConsoleLogger logger = new ConsoleLogger(LoggerVerbosity.Normal);
ProjectCollection pc = new ProjectCollection();
Dictionary<string, string> GlobalProperty = new Dictionary<string, string>();
//GlobalProperty.Add("Configuration", "Debug");
GlobalProperty.Add("Configuration", "Release");
//GlobalProperty.Add("Platform", "x86");
GlobalProperty.Add("Platform", "Any CPU");
GlobalProperty.Add("OutputPath", outputPath);
BuildParameters bp = new BuildParameters(pc);
bp.Loggers = new List<ILogger> { logger };
BuildRequestData BuidlRequest = new BuildRequestData(projectFilePath, GlobalProperty, "4.0", new string[] { "Build" }, null);
// THIS IS WHERE THE MAGIC HAPPENS - IN PROCESS MSBUILD
BuildResu
用C#代码编译另一个.net工程
最新推荐文章于 2025-06-23 03:06:18 发布