如何在Post-Build事件中使用OR语句?

Xai*_*oft 8 visual-studio-2010 post-build-event

我试图在Post-Build事件中使用带有OR的条件,但到目前为止,我没有运气.以下不起作用:

if not "$(ConfigurationName)" == "Debug" or not "$(ConfigurationName)" == "Release" (

但这有效:

if not "$(ConfigurationName)" == "Debug" (

对于第一个,我得到一个存在的代码4.

Chr*_*yva 8

似乎在Pre-Post Build事件中没有条件的OR/AND,至少根据它在这里缺乏文档:http://technet.microsoft.com/en-us/library/bb490920.aspx

您必须重新编写IF语句才能执行您想要执行的操作.

if not "$(ConfigurationName)" == "Debug" (
   rem do something
) else if not "$(ConfigurationName)" == "Release" (
   rem do the same thing as above
)
Run Code Online (Sandbox Code Playgroud)

希望有所帮助,尽管你的条件对我没有意义.:-)