简体   繁体   English

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

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

OK, I know this is for Visual Studio 6 but I have been able to compile CHM files from within Visual Studio for years: 好的,我知道这是针对Visual Studio 6的,但是多年来我已经能够从Visual Studio中编译CHM文件:

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

Now, on 2017 RC, I am having problems. 现在,在2017 RC上,我遇到了问题。

The Html Help folder is available: Html帮助文件夹可用:

可执行文件夹

So that bit is OK. 这样就可以了。

I have set the HHP file to compile to a CHM: 我已将HHP文件设置为可编译为CHM:

自定义设置

Yet, when I try to compile the HHP file I get this error: 但是,当我尝试编译HHP文件时,出现此错误:

1>C:\\Program Files (x86)\\Microsoft Visual Studio\\2017rc\\Community\\MSBuild\\15.0\\Bin\\Microsoft.Common.CurrentVersion.targets(3021,7): error MSB4057: The target "CoreCompile" does not exist in the project. 1> C:\\ Program Files(x86)\\ Microsoft Visual Studio \\ 2017rc \\ Community \\ MSBuild \\ 15.0 \\ Bin \\ Microsoft.Common.CurrentVersion.targets(3021,7):错误MSB4057:目标“ CoreCompile”不存在该项目。

I am really stumped. 我真的很沮丧。 I have tweaked and tweaked it and I can't build my HHP file using this method. 我已经对其进行了调整,并且无法使用此方法构建HHP文件。 At the moment I have to manually open it using Html Help Workshop and compile it there. 此刻,我必须使用Html帮助工作室手动打开它并在那里进行编译。

What is wrong? 怎么了?

Update: I am trying to right click the HHP and select Compile. 更新:我试图右键单击HHP,然后选择“编译”。

Update 2: I have got the settings right now: 更新2:我现在有了设置:

新的编译设置

But, there is a gotcha. 但是,有一个陷阱。 If I now try to compile the project, I get another error: 如果现在尝试编译项目,则会出现另一个错误:

1>C:\\Program Files (x86)\\Microsoft Visual Studio\\2017rc\\Community\\Common7\\IDE\\VC\\VCTargets\\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 1. 1> C:\\ Program Files(x86)\\ Microsoft Visual Studio \\ 2017rc \\ Community \\ Common7 \\ IDE \\ VC \\ VCTargets \\ Microsoft.CppCommon.targets(171,5):错误MSB6006:使用代码1退出了``cmd.exe'' 。

I don't have reproduced your error because I'm always compiling outside Visual Studio (VB). 我没有重现您的错误,因为我总是在Visual Studio(VB)之外进行编译。 I think it's the return code and totally down to hhc.exe, nothing else. 我认为这是返回码,完全取决于hhc.exe,仅此而已。

The trick is to look at the %ERRORLEVEL% after it runs. 诀窍是在%ERRORLEVEL%运行后查看它。 It returns "1" despite success. 尽管成功,它仍返回“ 1”。 This could be used in a custom command to warn the user it's spurious, if the hhc.exe run is isolated from other stuff. 如果hhc.exe运行与其他内容隔离开来,则可以在自定义命令中使用此命令来警告用户虚假。 HHC.exe is using HHA.dll. HHC.exe使用的是HHA.dll。 About HHA.dll info has not been published. 关于HHA.dll信息尚未发布。 Microsoft grant the HHA interface information under non-disclosure agreement (NDA) to approved help ISV's. Microsoft根据保密协议(NDA)将HHA接口信息授予已批准的帮助ISV。

To go around this and continue you need to add if not %errorlevel% 1 exit /B 1 in a batch file. 要解决此问题并继续,您需要在批处理文件中添加if not %errorlevel% 1 exit /B 1if not %errorlevel% 1 exit /B 1

For further information go deeper into following threads: 有关更多信息,请深入以下线程:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法使用Visual Studio 2017 RC进行XUnit测试 - Can't get XUnit tests working with Visual Studio 2017 RC MsBuild.exe与Visual Studio 2017的不同输出 - MsBuild.exe vs. Visual Studio 2017 different output 在visual studio 2010中找不到msbuild.exe - Can't find msbuild.exe in visual studio 2010 使用MSBuid.exe编译项目,但未使用nuget软件包安装Visual Studio - Compile project with MSBuid.exe but without visual studio installed using nuget packages 如何在安装了 Visual Studio 2017 的情况下获取 signtool.exe 的路径 - How to get path to signtool.exe with Visual Studio 2017 installed 添加在Visual Studio 2017 RC中构建.NET Core项目后运行的msbuild任务 - Add a msbuild task that runs after building a .NET Core project in Visual Studio 2017 RC 如何从Visual Studio 2017 RC中的.NET Core MSBuild项目创建NuGet包? - How do you create a NuGet package from a .NET Core MSBuild project in Visual Studio 2017 RC? 如何从 BAT 文件调用 Visual Studio 2017 RC 版本的 MSBuild? - How do I call Visual Studio 2017 RC's version of MSBuild from a BAT file? 升级到 Visual Studio 2017 后无法在命令提示符下运行 NMAKE - Can't run NMAKE in the command prompt after upgrade to Visual Studio 2017 Visual Studio 2017 无法正确解析特定引用 - Visual Studio 2017 doesn't resolve a specific reference correctly
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM