"如果"是VS 2010中的后期构建宏的语法

And*_*rey 15 visual-studio-2010 post-build-event visual-studio post-build

我正在尝试添加一个后构建宏,如果配置不是"Debug",它将在构建后有条件地复制一些文件.我正在尝试以下方法:

if ('$(ConfigurationName)' <> 'Debug')
    copy /y $(ProjectDir)memcached.$(ConfigurationName).config   
            $(ProjectDir)memcached.config 
Run Code Online (Sandbox Code Playgroud)

我得到错误255."if"语句的正确语法是什么?

And*_*rey 27

刚想通了:

if not $(ConfigurationName) == Debug  
   copy /y $(ProjectDir)memcached.$(ConfigurationName).config 
           $(ProjectDir)memcached.config
Run Code Online (Sandbox Code Playgroud)

  • 谢谢.让我疯了!试过<>,!=!($(x)== x).你会想到!=因为他们使用==会是它. (3认同)