简体   繁体   English

之前/之后的构建事件Visual Studio

[英]pre/post build event Visual Studio

How can I write pre build event, that will copy file from solution folder to document folder. 如何编写预构建事件,该事件会将文件从解决方案文件夹复制到文档文件夹。 Path to document can change(solution may be run on different machine) 文档路径可以更改(解决方案可以在其他计算机上运行)

you can use xcopy or copy command from DOS in pre or post build events. 您可以在构建前或构建后事件中使用DOS中的xcopy或copy命令。 I have used that to maintain multiple web config files in asp.net applications and multiple releases with different configuration in desktop applications. 我用它来维护asp.net应用程序中的多个Web配置文件和桌面应用程序中具有不同配置的多个发行版。

for example: xcopy "$(TargetPath)" "$(SolutionDir)$(OutDir)" /i /d /y 例如: xcopy "$(TargetPath)" "$(SolutionDir)$(OutDir)" /i /d /y

Also check out this article, this may help http://geekswithblogs.net/dchestnutt/archive/2006/05/30/80113.aspx 另外请查看这篇文章,这可能对http://geekswithblogs.net/dchestnutt/archive/2006/05/30/80113.aspx有帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM