Logging Build messages with MSBuild 4.0

故事扮演 提交于 2019-12-21 12:55:55

问题


I am using MsBuild 4.0 in code, like so:

 var globalProperties = new Dictionary<string, string>();
 var buildRequest = new BuildRequestData(solutionPathAbsolute, globalProperties, null, new string[] { "Build" }, null);
 var pc = new ProjectCollection();

 var result = BuildManager.DefaultBuildManager.Build(new BuildParameters(pc), buildRequest);

Note how this API is completely different from MsBuild 3.5... How does one hook in a logger to recieve detailed build messages with the new API?


回答1:


The BeginBuild method on the BuildManager allows you to pass in a set of BuildParameters which includes a Loggers property.



来源:https://stackoverflow.com/questions/3990386/logging-build-messages-with-msbuild-4-0

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!