设置“复制到输出目录”的方法基于配置
我想根据构建配置设置“复制到输出目录”属性。我还没有测试过,但我认为 Condition=" '$(Configuration)' == 'Release'"
应该可以正常工作。但有一个问题 - 我的项目中有很多内容文件,我将添加更多内容,并且我不想手动更改每个文件的属性。我可以编写一个修改所有内容条目的工具,但可能还有另一种方法吗?
编辑:在撰写本文时,我想要一种更简单的方法,但现在我认为任何其他方法都可以考虑,因此欢迎任何建议。
I want to set the "Copy to Output Directory" property based on the build configuration. I haven't tested yet, but I think the Condition=" '$(Configuration)' == 'Release'"
should work fine. There is a problem though - I have many content files in my project, I will add much more and I don't want to change each file's property manually. I could write a tool that modifies all content entries, but may be there is another way?
EDIT: at the time of writing this post I desired an easier way, but now I think any other way would be good to consider, so any suggestions are welcome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
决定采取简单的方法,在构建后通过 xcopy 复制内容,并将所有“复制到输出目录”属性设置为“不复制”:
Decided to take an easy route and copy content via xcopy on post-build and set all "copy to output directory" properties to "do not copy":