MSB3073:命令 "mc :VCEnd" 已退出,代码为 1

MSB3073: The command "mc :VCEnd" exited with code 1

我正在尝试在 visual studio 2019 年编译 log4cpp_x86,但它给我如下错误,

我尝试将项目的位置从 D: 更改为 C:,但问题仍然存在,而且我还取消了该文件夹的只读标记,但它也不起作用。

同样,当我单击错误(即标有 MSB3073 的错误)时,它会将我重定向到 Microsoft.CppCommon.targets 中的行,其中 xml 标记为:

  <Exec Command="%(CustomBuildStep.Command)$(_BuildSuffix)"/> 

正如@HansPassant 建议的 link 在我的案例中它是一半的解决方案,但是在按照 link 中建议的程序之前,我用 xml 标签如下,

<CustomBuildStep> <Command>mc $(InputPath)</Command> </CustomBuildStep>

旧项目的解决方案文件带有以下标签,

<CustomBuild Include="..\NTEventLogCategories.mc">
      <Command Condition="'$(Configuration)|$(Platform)'=='Debug with Boost|Win32'">"$(VS100COMNTOOLS)vsvars32.bat" if not exist $(OutDir) md $(OutDir)
mc.exe -h "$(OutDir)" -r "$(OutDir)" "$(ProjectDir)..\%(Filename).mc"
rc.exe -r -fo "$(OutDir)%(Filename).res" "$(OutDir)%(Filename).rc"
link.exe /MACHINE:IX86 -dll -noentry -out:"$(OutDir)NTEventLogAppender.dll" "$(OutDir)%(Filename).res"
</Command>
      <Command Condition="'$(Configuration)|$(Platform)'=='Debug with Boost|x64'">"$(VS100COMNTOOLS)vsvars32.bat" if not exist $(OutDir) md $(OutDir)
mc.exe -h "$(OutDir)" -r "$(OutDir)" "$(ProjectDir)..\%(Filename).mc"
rc.exe -r -fo "$(OutDir)%(Filename).res" "$(OutDir)%(Filename).rc"
link.exe /MACHINE:IX86 -dll -noentry -out:"$(OutDir)NTEventLogAppender.dll" "$(OutDir)%(Filename).res"
</Command>
      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug with Boost|Win32'">$(OutDir)NTEventLogAppender.dll;%(Outputs)</Outputs>
      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug with Boost|x64'">$(OutDir)NTEventLogAppender.dll;%(Outputs)</Outputs>
      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(VS100COMNTOOLS)vsvars32.bat" if not exist $(OutDir) md $(OutDir)
mc.exe -h "$(OutDir)" -r "$(OutDir)" "$(ProjectDir)..\%(Filename).mc"
rc.exe -r -fo "$(OutDir)%(Filename).res" "$(OutDir)%(Filename).rc"
link.exe /MACHINE:IX86 -dll -noentry -out:"$(OutDir)NTEventLogAppender.dll" "$(OutDir)%(Filename).res"
</Command>
      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">"$(VS100COMNTOOLS)vsvars32.bat" if not exist $(OutDir) md $(OutDir)
mc.exe -h "$(OutDir)" -r "$(OutDir)" "$(ProjectDir)..\%(Filename).mc"
rc.exe -r -fo "$(OutDir)%(Filename).res" "$(OutDir)%(Filename).rc"
link.exe /MACHINE:IX86 -dll -noentry -out:"$(OutDir)NTEventLogAppender.dll" "$(OutDir)%(Filename).res"
</Command>
      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(OutDir)NTEventLogAppender.dll;%(Outputs)</Outputs>
      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)NTEventLogAppender.dll;%(Outputs)</Outputs>
      <Command Condition="'$(Configuration)|$(Platform)'=='Release with Boost|Win32'">"$(VS100COMNTOOLS)vsvars32.bat" if not exist $(OutDir) md $(OutDir)
mc.exe -h $(OutDir) -r $(OutDir) $(ProjectDir)..\%(Filename).mc
RC.exe -r -fo $(OutDir)%(Filename).res $(OutDir)%(Filename).rc
link.exe /MACHINE:IX86 -dll -noentry -out:$(OutDir)NTEventLogAppender.dll $(OutDir)%(Filename).res
</Command>
      <Command Condition="'$(Configuration)|$(Platform)'=='Release with Boost|x64'">"$(VS100COMNTOOLS)vsvars32.bat" if not exist $(OutDir) md $(OutDir)
mc.exe -h $(OutDir) -r $(OutDir) $(ProjectDir)..\%(Filename).mc
RC.exe -r -fo $(OutDir)%(Filename).res $(OutDir)%(Filename).rc
link.exe /MACHINE:IX86 -dll -noentry -out:$(OutDir)NTEventLogAppender.dll $(OutDir)%(Filename).res
</Command>
      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release with Boost|Win32'">$(OutDir)NTEventLogAppender.dll;%(Outputs)</Outputs>
      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release with Boost|x64'">$(OutDir)NTEventLogAppender.dll;%(Outputs)</Outputs>
      <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(VS100COMNTOOLS)vsvars32.bat" if not exist $(OutDir) md $(OutDir)
mc.exe -h $(OutDir) -r $(OutDir) $(ProjectDir)..\%(Filename).mc
RC.exe -r -fo $(OutDir)%(Filename).res $(OutDir)%(Filename).rc
link.exe /MACHINE:IX86 -dll -noentry -out:$(OutDir)NTEventLogAppender.dll $(OutDir)%(Filename).res
</Command>
      <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">"$(VS100COMNTOOLS)vsvars32.bat" if not exist $(OutDir) md $(OutDir)
mc.exe -h $(OutDir) -r $(OutDir) $(ProjectDir)..\%(Filename).mc
RC.exe -r -fo $(OutDir)%(Filename).res $(OutDir)%(Filename).rc
link.exe /MACHINE:IX86 -dll -noentry -out:$(OutDir)NTEventLogAppender.dll $(OutDir)%(Filename).res
</Command>
      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(OutDir)NTEventLogAppender.dll;%(Outputs)</Outputs>
      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)NTEventLogAppender.dll;%(Outputs)</Outputs>
    </CustomBuild> 

然后我按照@HansPassant 的建议执行了 link 的步骤,但是我没有执行 link 中的第一步(即下载新版本的 log4cpp),而是我将项目替换为旧项目,然后根据 link 中的建议执行所有步骤,这解决了我的问题。