This project has moved and is read-only. For the latest updates, please go here.

SHFB: Error BE0035 Could not find the path to the Microsoft Sandcastle documentation compiler tools

Topics: Developer Forum, Project Management Forum, User Forum
Apr 1, 2009 at 6:04 AM

I have installed the latest version of the SHFB. The VS2008 SDK is installed. I have created a new project, added the assembly and the XML-Output from my VS 2008 project and i'm getting the following error:

[Sandcastle Help File Builder Utilities, version]

Creating output and working folders...


Clearing working folder...


Finding tools...

Last step completed in 00:00:00.0000


SHFB: Error BE0035: Could not find the path to the Microsoft Sandcastle documentation compiler tools. See error topic in help file for details.

According to the helpfile, i have to set the DXROOT variable however this has been set to C:\Program Files\Microsoft Visual Studio 2008 SDK\VisualStudioIntegration\Tools\Sandcastle\ProductionTools\.

Any help is appreciated.


Apr 1, 2009 at 4:24 PM
See the Requirements section in the Installation Instructions topic.  It will guide you through correcting the DXROOT environment variable.

Apr 1, 2009 at 10:26 PM

Hi Eric,


Thanks for your answer.


I guess I found the problem, which was produced by myself L


I installed only the Sandcastle Help File Builder without installing the Sandcastle May 2008 Release (Version 2.4.10520)!

It's working now.

Krgds, Sascha 

Apr 7, 2010 at 6:02 PM

Eric, I'm running into this error and can't figure it out.  It's on a Server '08 box, the DXROOT variable is set properly to C:\Program Files (x86)\Sandcastle\, but it errors.  Also, I can't get the syntax right to increase verbosity through  the build task.  I've got it below, any help would be much appreciated.


Apr 7, 2010 at 8:25 PM

Full output is always written to the SHFB build log so you can look there for details about the failure.  If it's having problems finding the path to Sandcastle automatically, you should be able to override the SandcastlePath project property to tell it where to look (Properties="SandcastlePath=$(DXROOT)" for example).



Apr 7, 2010 at 10:16 PM

Thanks for the reply.  Unfortunately I haven't found the log very helpful, which is why I was trying to verify if it was possible to increase the verbosity of it.  I'll paste the entire log at the bottom.

Also, when I specify the SandcastlePath as you suggest, it tries to find the SHFB targets file at that path as well, even though the SHFBROOT environment variable is set correctly.


<?xml version="1.0" encoding="utf-8"?>
<shfbBuild product="Sandcastle Help File Builder Utilities" version="" projectFile="C:\Builds\Debug\Build\Sandcastle.shfbproj" started="4/7/2010 1:56:01 PM">
<buildStep step="Initializing">
<buildStep step="ClearWorkFolder">
Clearing working folder...
<buildStep step="FindingTools">
Finding tools...
    Last step completed in 00:00:00.0000
<buildStep step="Failed">

SHFB: Error BE0035: Could not find the path to the Microsoft Sandcastle documentation compiler tools.  See error topic in help file for details.



Apr 8, 2010 at 3:08 AM
Edited Apr 8, 2010 at 3:22 AM

DXROOT is unrelated to SHFBROOT.  Have you got the environment variables set up as system environment variables?  You could try adding a Message task to your build project to echo back the value of DXROOT and SHFBROOT to see if they're making it into the project.  If they are, I see no reason that SHFB wouldn't pick them up too.  As a last resort you could put the path in the SHFB project file itself in the SandcastlePath property.

All you need to know about the BE0035 error code is noted in the related help topic.  It's just not finding Sandcastle based on the setting of DXROOT, the PATH if DXROOT isn't defined, or a folder search if all else fails.  It only looks at the PATH environment variable if DXROOT isn't defined, and only resorts to the folder scan if it can't find it via PATH.  So, if DXROOT is some how incorrect, that will stop it looking any further.  Setting the path in the project overrides the above behavior altogether.

If it still fails with the path defined in the project, something else is causing it to fail.  Is it perhaps a permissions issue on the folder?  If the build process can't search the folder, it won't find the tools.



Apr 8, 2010 at 4:10 PM

Both variables are defined as system environment variables, and there is not a user defined variable for either.  I added the message tasks and both paths are correct, but I still get the BE0035 error.

I reviewed the installation instructions, and the only thing I haven't installed is the MS help 2 compiler.  We don't, and won't, have Visual Studio installed on the build server.  Is this possibly the problem, and if so, is there a workaround?

Thanks again for staying active with support and troubleshooting!

Apr 8, 2010 at 8:26 PM

No the Help 2 compiler isn't required unless you are building Help 2 files.  The failure is when it goes to look for the Sandcastle Tools (MRefBuilder, etc).  As it is right now, your only option appears to be to put the path in the project using the SandcastlePath project property.  If it still fails after that, then it's something else such as lack of permissions to the folder for the account doing the build or something.



Apr 12, 2010 at 5:02 PM

I've found a solution, but haven't been able to 100% diagnose the source of the issue I'm facing.  There appears to be some conflict with the SandcastlePath property in the code.

For example, I set the SandcastlePath property in my build file, and it errors because it is trying to find the SHFB targets file in that path:

errorMSB4019: The imported project "C:\Sandcastle\SandcastleHelpFileBuilder.targets" was not found.

Next I downloaded the source code and added some additional reporting in the FindTools method:

            if(sandcastleFolder.Length != 0 &&
              sandcastleFolder[sandcastleFolder.Length - 1] != '\\')
                sandcastleFolder += @"\";

            this.ReportProgress(BuildStep.FindingTools, string.Format("sandcastleFolder: {0}", sandcastleFolder));
            this.ReportProgress(BuildStep.FindingTools, string.Format("Directory Exists: {0}", Directory.Exists(sandcastleFolder)));
            this.ReportProgress(BuildStep.FindingTools, string.Format("File Exists: {0}", File.Exists(sandcastleFolder + @"ProductionTools\MRefBuilder.exe")));

            if(sandcastleFolder.Length == 0 ||
              !Directory.Exists(sandcastleFolder) || !File.Exists(
              sandcastleFolder + @"ProductionTools\MRefBuilder.exe"))
                throw new BuilderException("BE0035", "Could not find the " +
                    "path to the Microsoft Sandcastle documentation " +
                    "compiler tools.  See error topic in help file for " +

The folder should be C:\Sandcastle, but returns the SHFB directory:

<message level="normal"><![CDATA[sandcastleFolder: C:\Program Files (x86)\EWSoftware\Sandcastle Help File Builder\]]></message>

So I edited line 1797 of the BuildProcess file where it's setting the folder to project.SandcastlePath to set it to String.Empty.  This then allowed it to use the path that is set in the DXROOT environment variable, which allowed it to build successfully.

Apr 12, 2010 at 7:38 PM

I found why setting the SandcastlePath property was causing my build to not find the targets file.  I had pulled an old shfb file through the conversion and somehow the Import target was incorrect.

<Import Project="$(SandcastlePath)\SandcastleHelpFileBuilder.targets" />
I still didn't find where SandcastlePath is being set incorrectly when I don't specify it, so I'm keeping my edit that allows it to default to the DXROOT setting.


Apr 12, 2010 at 7:47 PM

And I spoke too soon.  My shfbproj file also specified the SandcastlePath and was incorrect.  I ran my original .shfb through the conversion again and these values weren't being set incorrectly so I was apparently setting them without realizing I was setting it up wrong.

Thanks again for the help.

Aug 29, 2011 at 6:07 AM

Just to throw another perspective in...

I was running into this error when trying to move from an x64 to a Win32 machine. I found that by deleting this line out of my project file (an old but upgraded one):

<SandcastlePath>C:\Program Files (x86)\Sandcastle\</SandcastlePath>

the project built successfully.