无法使用 HHC.EXE 和 Visual Studio 2017 RC 将 HHP 编译成 CHM

Can't compile a HHP into CHM using HHC.EXE with Visual Studio 2017 RC

好的,我知道这是针对 Visual Studio 6 的,但多年来我一直能够从 Visual Studio 内编译 CHM 文件:

https://msdn.microsoft.com/en-us/library/aa733976(v=vs.60).aspx

现在,在 2017 RC 上,我遇到了问题。

Html 帮助文件夹可用:

所以那个位没问题。

我已将 HHP 文件设置为编译为 CHM:

然而,当我尝试编译 HHP 文件时出现此错误:

1>C:\Program Files (x86)\Microsoft Visual Studio17rc\Community\MSBuild.0\Bin\Microsoft.Common.CurrentVersion.targets(3021,7): error MSB4057: The target "CoreCompile" does not exist in the project.

我真的很难过。我对它进行了调整和调整,但我无法使用这种方法构建我的 HHP 文件。目前我必须使用 Html Help Workshop 手动打开它并在那里编译它。

怎么了?

更新:我正在尝试右键单击 HHP 并 select 编译。

更新 2:我现在已经有了设置:

但是,有一个陷阱。如果我现在尝试编译该项目,我会收到另一个错误:

1>C:\Program Files (x86)\Microsoft Visual Studio17rc\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 1.

我没有重现你的错误,因为我总是在 Visual Studio (VB) 之外编译。我认为这是 return 代码,完全是 hhc.exe,没有别的。

诀窍是查看 运行 之后的 %ERRORLEVEL%。尽管成功,它 return 还是“1”。如果 hhc.exe 运行 与其他内容隔离,这可以在自定义命令中用于警告用户它是虚假的。 HHC.exe 正在使用 HHA.dll。关于 HHA.dll 的信息尚未发布。 Microsoft 根据保密协议 (NDA) 将 HHA 接口信息授予批准的帮助 ISV。

要解决此问题并继续,您需要在批处理文件中添加 if not %errorlevel% 1 exit /B 1

要了解更多信息,请深入了解以下主题:

  • HTMLHelp compiler works perfectly from command line but not run from a script or batch file