<分区>
有没有办法在构建事件中设置不相等的条件?
像这样:
if $(ConfigurationName) != Debug xcopy ...
请注意,这是构建事件(类似批处理的语法),而不是 MSBuild 任务(确实支持 != )。
标签 c# visual-studio
<分区>
有没有办法在构建事件中设置不相等的条件?
像这样:
if $(ConfigurationName) != Debug xcopy ...
请注意,这是构建事件(类似批处理的语法),而不是 MSBuild 任务(确实支持 != )。
最佳答案
更新:
不好意思,我以为它是为 MSBuild 而设计的。但是,如果它仅用于构建事件,那么它将像 batch
脚本一样工作
if not "$(ConfigurationName)" == "Debug" (
echo "hello world"
)
对于 MSBuild
就像是在关注
Condition="'$(Configuration)'!='DEBUG'"
例如:
<When Condition=" '$(Configuration)'!='DEBUG' ">
....
</When>
查看详情 MSBuild condition
关于c# - Visual Studio 构建事件条件不相等,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34682325/