AfterBuild 包含一个 IF 语句

AfterBuild contains an IF statement

请参阅以下构建后命令 (BuildEvents\PostBuildEventCommandLine):

   if "Release" ==" $(ConfigurationName)" (
       call C:\Users12627\Documents\trunk\Genie2\AssignStrongNameSerializer.bat 
     )

如果我删除 IF 语句,那么批处理脚本会在生成后运行。但是,如果我包含它,那么它就不会。我肯定在配置管理器中选择了发布版本而不是调试版本。 IF 语句有什么问题?

您的字符串中有一个额外的前导 space:

" $(ConfigurationName)"

但你应该使用

"$(ConfigurationName)"

因为 "Release" <> " Release"