【发布时间】:2015-06-19 19:54:25
【问题描述】:
我是 MSBuild 新手,忙于 Visual Studio 解决方案的自动化测试。
我之前使用过Devenv 的命令行,它提供了一种方便的/Runexit 操作模式。来自手册:
/Runexit (devenv.exe)
Compiles and runs the specified solution, minimizes the IDE when the solution is run,
and closes the IDE after the solution has finished running.
这正是我需要的功能。我现在正在迁移到 MSBuild。我发现解决方案中的项目文件可以直接用于构建,因为默认的目标正是构建。
我可以做些什么来处理不同的目标,这将与/Runexit 具有相同的效果?你能帮我穿过迷宫吗?
【问题讨论】:
-
究竟有什么不同的目标?假设您运行测试的目标是
Test,那么您将运行msbuild /t:Rebuild;Test先重建然后测试.. -
@stijn 我的问题正是如何创建一个将执行构建结果的目标,即
Test.exe。项目文件中默认没有这样的target。
标签: visual-studio msbuild build-automation