使用MSBuild进行条件编译

MSBuild支持自定义编译条件,通过查看条件编译在proj文件中的定义,我们可以在MSBuild的参数中定义编译条件。如下:

MSBuild MySolution.sln /t:rebuild /p:configuration=Debug;OutDir=bin\TRIAL\;DefineConstants=TRIAL


最后的这个 DefineConstants就是用来定义编译条件的。

原文地址:https://www.cnblogs.com/hhh/p/1408825.html