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

Topics: Developer Forum, Project Management Forum
May 30, 2012 at 8:02 AM

Ik created a batch file which contains:

call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\vsvars32.bat"
msbuild "C:\Users\myUser\Documents\Visual Studio 2010\GeneratedDocumentationNewRelease\XceleraNewReleaseDoc.shfbproj"

When I run this batch file I get the following error:

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

I run this on a Windows 7 OS with Sandcastle version:1.9.4.0.

I get different error when I build for Debug and Release. The error above is raised when I build for Debug.

Does someone know what the cause of this problem can be?

Here is a stripped output of the Build Log (I removed quite some  source-, project files and assemblies :

<?xml version="1.0" encoding="utf-8"?>
<shfbBuild product="Sandcastle Help File Builder" version="1.9.4.0" projectFile="C:\Users\myUser\Documents\Visual Studio 2010\GeneratedDocumentationNewRelease\XceleraNewReleaseDoc.shfbproj" started="2012-05-23 2:58:26 PM">
<buildStep step="Initializing">
</buildStep>
<buildStep step="ClearWorkFolder">
Clearing working folder...
</buildStep>
<buildStep step="FindingTools">
Finding tools...
Found Sandcastle tools in &#39;C:\Program Files (x86)\Sandcastle\&#39;
Searching for HTML Help 1 compiler...
Found HTML Help 1 compiler in &#39;C:\Program Files (x86)\HTML Help Workshop\&#39;
</buildStep>
<buildStep step="ValidatingDocumentationSources">
Validating and copying documentation source information
Source: D:\TFS\CTrunk\TestSolution.sln
    Found project &#39;D:\TFS\CTrunk\XXXX.csproj&#39;

Parsing project files
    Found assembly &#39;D:\TFS\CTrunk\XXXXX.dll&#39;

References to use:
    Accessibility

Copying XML comments files
    D:\TFS\CTrunk\XXXX.XML -&gt; C:\Users\myUser\XXXXX.XML
    D:\TFS\CTrunk\XXXXX.XML -&gt; C:\Users\myUser\XXXXX.XML
</buildStep>
<buildStep step="GenerateSharedContent">
Generating shared content files (en-US, English (United States))...
    Last step completed in 00:00:00.0550
</buildStep>
<buildStep step="GenerateApiFilter">
Generating API filter for MRefBuilder...
    Last step completed in 00:00:00.0130
</buildStep>
<buildStep step="GenerateReflectionInfo">
Generating reflection information...
[C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe]
  MRefBuilder (v2.7.0.0)
  Copyright c 2006-2012, Microsoft Corporation, All Rights Reserved
  Info: Loaded 109 assemblies for reflection and 111 dependency assemblies.
  Info: Wrote information on 325 namespaces, 2389 types, and 24231 members
  XslTransform (v2.7.0.0)
  Copyright c 2006-2012, Microsoft Corporation, All Rights Reserved
  Info: Applying XSL transformation &#39;C:\Program Files (x86)\Sandcastle\ProductionTransforms\MergeDuplicates.xsl&#39;.
    Last step completed in 00:00:25.7101
</buildStep>
<buildStep step="GenerateNamespaceSummaries">
Generating namespace summary information...
    Last step completed in 00:00:00.1085
</buildStep>
<buildStep step="ApplyVisibilityProperties">
Applying visibility properties to reflection information file
    8604 attribute nodes removed
    314 explicit interface implementations removed
    1971 local and base class EII elements removed
    Last step completed in 00:00:04.1383
</buildStep>
<buildStep step="TransformReflectionInfo">
Transforming reflection output...
[C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe]
  XslTransform (v2.7.0.0)
  Copyright c 2006-2012, Microsoft Corporation, All Rights Reserved
  Info: Applying XSL transformation &#39;C:\Program Files (x86)\Sandcastle\ProductionTransforms\ApplyVSDocModel.xsl&#39;.
  Info: Applying XSL transformation &#39;C:\Program Files (x86)\Sandcastle\ProductionTransforms\AddGuidFilenames.xsl&#39;.
  XslTransform (v2.7.0.0)
  Copyright c 2006-2012, Microsoft Corporation, All Rights Reserved
  Info: Applying XSL transformation &#39;C:\Program Files (x86)\Sandcastle\ProductionTransforms\ReflectionToManifest.xsl&#39;.
    Last step completed in 00:01:53.9553
</buildStep>
<buildStep step="Failed">

SHFB: Error BE0065: BUILD FAILED: Exception of type &#39;System.OutOfMemoryException&#39; was thrown.

</buildStep>
</shfbBuild>

Coordinator
May 30, 2012 at 8:20 PM

With 109 assemblies, it would appear the reflection information generated from them is too large for the XSL transformation step to handle.  The only workaround would be to split the assemblies between two or more help projects to reduce the amount of reflection data that is generated.

Eric

 

Jun 4, 2012 at 3:59 PM

Hi Eric,

Thank you for your response. I can try what you suggested, however it's not the kind of work around which (solution) I was looking for. We have integrated the Sandcastle in our build engine and the result needs to be copied to another server which is accessible for other developers. By splitting it up in two (or more) project I will get multiple HTML Help file which is not desireable. However I will check if can can merge help files or see what kind of other possibilities we have.

Furthermore to understand the problem, why don't I get this problem when I am generating a help text with the Sandcastle Help File Builder?

 

 

Coordinator
Jun 4, 2012 at 7:04 PM

The simple answer is that the amount of reflection data generated from the set of assemblies as a whole is just too much for the XSL transformation step to handle.  It can't load it all into memory or runs out during the process of transforming it to generate the manifest file.

Eric