Error running from Team Build

Topics: User Forum
Jul 30, 2007 at 11:02 PM
I am receiving the following error "exec"ing SHFB from (VSTS) Team Build.

Sandcastle Help File Builder Console, version
Generating reflection information...
MrefBuilder (v2.2.64000.4)
Copyright c Microsoft 2006
Error: A file access error occured while attempting to load the component assembly '%DXROOT%\ProductionTools\MRefBuilder.exe'. The error message is: Could not load file or assembly 'file:///c:\Builds\CSS\SDK\Sources\Sdk\Help\Working\%DXROOT%\ProductionTools\MRefBuilder.exe' or one of its dependencies. The system cannot find the file specified.

However, I do not receive the error if I run from the SHFB GUI or command line. I have verified the (service) account launching the build has local admin privileges. This did not occur until I upgraded to the latest SHFB and Sandcaslte releases.
Jul 31, 2007 at 1:30 AM
There's a bug in the current version's GenerateRefInfo.bat template file (it's in the .\Templates folder under the help file builder install folder). Edit it and replace "%DXROOT%" with "{@SandcastlePath}" to match the other paths and it should work. Note also that DXROOT is a user environment variable. You might want to make it a global environment variable on the server so that it finds Sandcastle more efficiently. It tries DXROOT first and if it doesn't find it, it has to search the Program Files folder.

Jul 31, 2007 at 3:02 PM
I checked the machine and both the GeenerateRefInfo.bat template file and the environment variable were correct. I also searched for additional copies of the .bat file but there was only the single one. I tried to uninstall both Sandcastle & SHFB, rebooting, and reinstalling (and validating the two settings mentioned again) but the same results still occur.
Jul 31, 2007 at 5:37 PM
I was mistaken on the batch file being incorrect. It's the MRefBuilder.config file template. Edit that file and you should find a DXROOT reference. Change that to {@SandcastlePath} and it should work. As I recall it's on the <resolver> element which was added in this release:

<resolver type="Microsoft.Ddue.Tools.Reflection.AssemblyResolver" assembly="{@SandcastlePath}ProductionTools\MRefBuilder.exe" use-gac="false" />

Jul 31, 2007 at 9:28 PM
That did the trick. Thanks for your help Eric!
Aug 22, 2007 at 6:33 PM
I was getting the same error using the GUI and found this to be the solution for the same problem.
Oct 25, 2007 at 8:44 AM
Same here. Was getting the same problem trying to integrate with ccnet, thus using SandcastlePath. The {@SandcastlePath} replacing DXROOT fix solved it.

Dec 27, 2007 at 8:43 AM
Eric, I have updated the resolver element with "{@SandcastlePath}ProductionTools\MRefBuilder.exe, but still I m getting the error,
EXEC : error : A file access error occured while attempting to load the component assembly 'C:\Program Files\Sandcastle\ProductionTools\@{SandcastlePath}\ProductionTools\MRefBuilder.exe'. The error message is: Could not load file or assembly 'file:///C:\Program Files\Sandcastle\ProductionTools\@{SandcastlePath}\ProductionTools\MRefBuilder.exe' or one of its dependencies. The system cannot find the file specified.
Dec 27, 2007 at 3:55 PM
"{@SandcastlePath}" shouldn't be in the path once its resolved. Be sure you are using either or as both contain the fix noted above and also that you have not modified the files if you are. If you get an error when using either one of those with unmodified files, then report the actual error using those files. Start a new thread though as I doubt it relates to this problem anymore.

Dec 31, 2007 at 10:36 AM
Hi Eric, Is it possible to stop the traversing through reflection assemblies in MRefBuilder (EXE), in my case I have multiple solutions, where one of solutions binaries are reference another solution binaries. But while building the documentaion file, for one solution, I dont want to display the help of another solution in same help viewer. I have tried with mrefbuilder command switches, but not able to get :-(
Below is the error I am getting
D:\MyProject\Test>mrefbuilder *.dll /
MrefBuilder (v2.3.8000.26)
Copyright c Microsoft 2006
Info: Loaded 22 assemblies for reflection and 0 dependency assemblies.
Error: Unresolved assembly reference: Solution1.Controls (Solution1.Controls, Version=, Culture=neutral, PublicKeyToken=d226ba0668d9a262) required by MyConsumer

where, I dont want to show the contents of the Solution1.Controls and dont want to put the binaries of Solution1.Controls in Solutions2's binaries folder
Thanks in advance
Dec 31, 2007 at 5:39 PM
If you don't want an assembly documented but it is referenced by the ones you do want documented, add it to the Dependencies property instead. This lets MRefBuilder find it and resolve references to types in it but they won't appear in the resulting documentation file.

Jan 2, 2008 at 9:35 AM
Thanks Eric, this solves my problem, but I have to copy all dependent binaries scattered in multiple locations to single location to specify the path...
Jan 2, 2008 at 3:14 PM
Edited Jan 2, 2008 at 3:16 PM
There are three buttons at the bottom of the Dependencies dialog box. You can add folder, single file, or GAC dependencies, it doesn't care where they actually reside. You can also add as many as you need. The help file builder will copy them from the source locations to a common location under the working folder for the build. As such, you can add the references that point to the various source locations and don't need to copy them anywhere.

Jan 4, 2008 at 6:21 AM
Actually I am trying to generate the sandcastle documentation without using SHFB. Hence in my case I am copying the dependent binaries to unique location