如何以编程方式列出在执行MSBuild时定义的所有属性? [英] How to programmatically list all properties defined while executing MSBuild?

查看:48
本文介绍了如何以编程方式列出在执行MSBuild时定义的所有属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种方法来访问在执行MSBuild时定义的所有Build属性.我有一个配置文件.我想修改配置文件中的属性并将其复制到新位置.有办法吗?

I'm looking for a way to access all the Build properties defined while executing MSBuild. I have a configuration file. I want to modify the Properties in the configuration file and copy it to a new location. Is there a way to do it?

推荐答案

如果使用/verbosity:detailed或/verbosity:diagnostic运行构建,您将获得构建过程中使用的所有属性的非常详细的输出.但是我怀疑您想在将生成的文件复制到另一个位置之后/之前更改配置类型的文件吗?在这种情况下,可以通过以下几种方法来执行此操作,我们发现效果很好,那就是可以在此处找到的MSBuildCommunity任务.在代码plex上

If you run the build with /verbosity:detailed or /verbosity:diagnostic you will get very detailed output of all the properties that was used during your build process. However I suspect you want to change a config type file after/before you copy the builded files to another location? In that case there is several mechanismes to do that, what we have found to work pretty good, is the MSBuildCommunity tasks that can be found here on code plex

如果您想查看其中的一些示例,我很乐意将其发布

If you would like to see some samples of this I would be glad to post them

这篇关于如何以编程方式列出在执行MSBuild时定义的所有属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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