使用MSBuild 4.0记录构建消息 [英] Logging Build messages with MSBuild 4.0

查看:121
本文介绍了使用MSBuild 4.0记录构建消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在代码中使用MsBuild 4.0,就像这样:

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);

请注意,此API与MsBuild 3.5有何完全不同...记录器中的一个钩子如何通过新API接收详细的构建消息?

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?

推荐答案

BuildParameters ,其中包括Loggers属性.

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

这篇关于使用MSBuild 4.0记录构建消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆