我想在构建后事件中使用带有OR条件的条件语句,但目前尚未成功。以下代码不起作用:
if not "$(ConfigurationName)" == "Debug" or not "$(ConfigurationName)" == "Release" (
但以下代码可以正常工作:
if not "$(ConfigurationName)" == "Debug" (
使用第一个代码时,我会得到一个退出代码4。
我想在构建后事件中使用带有OR条件的条件语句,但目前尚未成功。以下代码不起作用:
if not "$(ConfigurationName)" == "Debug" or not "$(ConfigurationName)" == "Release" (
但以下代码可以正常工作:
if not "$(ConfigurationName)" == "Debug" (
使用第一个代码时,我会得到一个退出代码4。
根据这里缺乏文档记录: http://technet.microsoft.com/en-us/library/bb490920.aspx,在Pre-Post构建事件的条件语句中似乎没有OR/AND的规定。
你需要重新编写IF语句以实现你想要的功能。
if not "$(ConfigurationName)" == "Debug" (
rem do something
) else if not "$(ConfigurationName)" == "Release" (
rem do the same thing as above
)
希望这些能有所帮助,尽管你的条件对我来说没有意义。 :-)if not "$(ConfigurationName)" == "Debug" (if not "$(ConfigurationName)" == "Release" (***添加逻辑代码 - 配置名称不是“Debug”或“Release”***))