如何以编程方式列出执行 MSBuild 时定义的所有属性?
我正在寻找一种方法来访问执行 MSBuild 时定义的所有构建属性。 我有一个配置文件。 我想修改配置文件中的属性并将其复制到新位置。 有办法做到吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用 /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