编译 .NET Standard 版本的 CSCore 时,MSBUILD PostBuildEvent 命令退出并显示错误代码 -1

问题描述

编译时,MSBUILD 在第 5574 行的 PostBuildEvent 文件中运行 Microsoft.Common.CurrentVersion.targets 命令,导致构建以 code -1 退出

CSCore github repo

来自 Microsoft.Common.CurrentVersion.targets 文件代码

  <Target
      Name="PostBuildEvent"
      Condition="'$(PostBuildEvent)' != '' and ('$(RunPostBuildEvent)' != 'OnOutputUpdated' or '$(_AssemblyTimestampBeforeCompile)' != '$(_AssemblyTimestampAfterCompile)')"
      DependsOnTargets="$(PostBuildEventDependsOn)">

    <Exec WorkingDirectory="$(OutDir)" Command="$(PostBuildEvent)" />

  </Target>

注意:要编译代码,必须卸载解决方案中仍然存在的所有 .NET Framework 项目。即“Samples”文件夹中的所有项目、Cscore.Linux 项目和 Cscore.Test 项目。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)