How to use generate Help 2.x?

Topics: Bugs, General Questions, Help 1.x/2.x
Jun 22, 2007 at 2:16 AM
Hey this is my first post here, so let me start by saying I LOVE THIS PROGRAM! Thank you very much, I just switched over to C# and .NET 2.0 and this has saved me SOOO much time from having to write all the documentation myself.

OK the issue :). I installed DocProject(latest build) then ran it fine. I noticed later on I wanted Help 2.x involved. So I removed the project out of my solution and installed the VS2005 SDK. Then I repaired installed DocProject. When I went to create a new project it says Help 2.x is not installed. I then went to check it in the tools options and it says that Help 2.x compiler is not installed.

So where do I go from here to get it to recognize Help 2.x?

Thanks again, and thank you for saving me a ton of work!
Jun 22, 2007 at 4:17 AM

Thanks for the feedback!

You should also reinstall Sandcastle, although that has nothing to do with this problem. The VS2005 SDK comes with an older version of Sandcastle and when it's installed it updates the %DXROOT% environment variable to point to the older version. DocProject uses this environment variable to locate Sandcastle, so reinstalling Sandcastle should reset %DXROOT% to the latest version. Microsoft is aware of this issue and there is a comment about it on Sandcastle's download page.

To fix the Help 2.x issue you should try rebooting. DocProject uses COM interfaces to build Help 2.x. The interfaces should have been registered when the VS2005 SDK was installed, but the registry changes may require a reboot to be committed.

If that doesn't work then please let me know and I'll try to help diagnose the problem.

Jun 22, 2007 at 7:52 PM
thanks for the reply dave, but still a no go :(.

I went ahead and removed sandcastle and docproject. I then reinstalled sandcastle then reinstalled docproject. I then rebooted and went to install a new DocProject project. No luck with being able to select Help 2.x... Any ideas here? Were can I change it manually or test if indeed the compiler is not installed?

Thanks again very much,
Jun 22, 2007 at 9:06 PM

DocProject references Microsoft Help HxComp 1.0 Compiler Services, which is commonly located at C:\Program Files\Visual Studio 2005 SDK\2007.02\VisualStudioIntegration\Archive\HelpIntegration\hxcsrv.exe.

In order to detect whether it is installed I've created a class named Help2CompilerLoader in the DaveSexton.DocProject.Sandcastle project. The loader simply attempts to create an instance of HxCompClass. But that code in particular doesn't log exceptions, although it probably should. If an exception occurs it just assumes that you have not installed the library.

You can try creating an instance of the compiler in a test project. Create a new console project and reference the COM service that I mentioned above (found on the COM tab). Then simply create an instance of MSHelpCompiler.HxCompClass and see if you get an exception.

If there is no exception then you may want to try rebuilding DocProject's Sandcastle plug-in assembly with the appropriate code to log the exception to the Application event log. Here's a snippet of what the Help2CompilerLoader.ForceAssemblyLoad method should look like with the log function being used for COMException, although you'll probably want to log all exceptions that are caught:

  MSHelpCompiler.HxCompClass temp = new HxCompClass();
  return temp != null;
catch (System.Runtime.InteropServices.COMException ex)
  Log.Exception(ex, "Error loading Help 2.x compiler:");
For help preparing and using the source code, see How To Use The Source Code.

Please keep me posted :)