sandcastle building error "System.OutOfMemory"

Apr 12, 2012 at 6:20 AM

Hi ,

can any one help me out with a problem. Whenever i am tried to build sandcastle project it always through a error "system.OutofMemory Exception". The dll which i am using for build is of 7 MB and using 32 bit operating system to run it. I am able to build for rest of the dll's which of less than 3 MB.   

Apr 12, 2012 at 1:52 PM


At what stage in your build process do you get the exception?

Best regards,

Apr 13, 2012 at 4:08 AM
Edited Apr 13, 2012 at 4:08 AM

Hi ,

Below is the stage where i get this error.




Generating reflection information...


MrefBuilder (v2.6.10621.1)

Copyright c Microsoft 2006

Info: Loaded 1 assemblies for reflection and 81 dependency assemblies.

Info: Wrote information on 1 namespaces, 626 types, and 3341 members

XslTransform (v2.6.10621.1)

Copyright c Microsoft 2005-2006

Info: Applying XSL transformation 'C:\Program Files\Sandcastle\ProductionTransforms\MergeDuplicates.xsl'.

reflection.all ->

Last step completed in 00:00:57.0738


Generating namespace summary information...

Last step completed in 00:00:00.3711


Applying visibility properties to reflection information file

581 attribute nodes removed

0 explicit interface implementations removed

3501 local and base class EII elements removed

Last step completed in 00:00:16.4886


Transforming reflection output...


XslTransform (v2.6.10621.1)

Copyright c Microsoft 2005-2006

Info: Applying XSL transformation 'C:\Program Files\Sandcastle\ProductionTransforms\ApplyVSDocModel.xsl'. -> C:\Users\pprahara\AppData\Local\Temp\tmpC0D8.tmp

Info: Applying XSL transformation 'C:\Program Files\Sandcastle\ProductionTransforms\AddGuidFilenames.xsl'.

C:\Users\pprahara\AppData\Local\Temp\tmpC0D8.tmp -> reflection.xml

XslTransform (v2.6.10621.1)

Copyright c Microsoft 2005-2006

Info: Applying XSL transformation 'C:\Program Files\Sandcastle\ProductionTransforms\ReflectionToManifest.xsl'.

reflection.xml -> manifest.xml

Last step completed in 00:11:48.8368


SHFB: Error BE0065: BUILD FAILED: Exception of type 'System.OutOfMemoryException' was thrown.

Apr 13, 2012 at 2:34 PM
Edited Apr 13, 2012 at 2:36 PM


Thanks for the information. Unfortunately, I may not be able to give correct interpretation
to the log file since the exception information is being displayed outside the "stage block". 

If you do not mind, can you try the following and tell us the results?

1. Build the help file outside the Visual Studio (it seems you are using the VS.NET, ignore this if that is not the case)

2. Run this simple batch file, in the directory where you have the assembly file, it will perform the above steps.

Simply paste this in a file with extension .bat, save it to the directory where your assembly is and run it.

REM ********** Set path for .net framework2.0, sandcastle,hhc,hxcomp****************************

set PATH=%windir%\Microsoft.NET\Framework\v2.0.50727;%DXROOT%\ProductionTools;%ProgramFiles%\HTML Help Workshop;%ProgramFiles%\Microsoft Help 2.0 SDK;%PATH%

if exist output rmdir output /s /q
if exist Help rmdir Help /s /q

REM ********** Call MRefBuilder ****************************

MRefBuilder ClassLibrary1.dll /

REM ********** Apply Transforms ****************************

XslTransform /xsl:"%DXROOT%\ProductionTransforms\ApplyVSDocModel.xsl" /xsl:"%DXROOT%\ProductionTransforms\AddGuidFilenames.xsl" /out:reflection.xml /arg:IncludeAllMembersTopic=true /arg:IncludeInheritedOverloadTopics=true

XslTransform /xsl:"%DXROOT%\ProductionTransforms\ReflectionToManifest.xsl"  reflection.xml /out:manifest.xml


NOTE: Please change the ClassLibray1.dll to the name of your assembly and set the .NET framework directory to reflect your assembly target (if this fails).

Best regards,


Apr 13, 2012 at 8:48 PM

It appears to be running out of memory applying the XSL transformation that produces the manifest or more likely shortly thereafter when SHFB loads the updated reflection file to modify the topic filenames and for the default topic lookup.  If you are running this from within Visual Studio, you might try building the project from the standalone SHFB GUI which may give it a bit more memory to work with.  If that doesn't work, you can try building the project from the command line with MSBuild to remove the GUIs completely.  If it still fails, unfortunately there isn't much that can be done at this time.  However, the tools are build to run as 64-bit if ran on a 64-bit system so it's possible they could take advantage of a 64-bit system with more memory.  Note that even if SHFB wasn't used it would most likely fail later on in the BuildAssembler phase as BuildAssembler also has to load info from the same reflection data file along with a lot of other info.  I plan on looking into those issues in a future release of Sandcastle.