MRefBuilder: Stack Overflow

Apr 11, 2008 at 10:03 AM
MRefBuilder ends with:

Process is terminated due to StackOverflowException.
Last step completed in 00:00:21.1406

BUILD FAILED: Root element is missing.

Any idea? Can I run source code to find the real problem?

Apr 11, 2008 at 10:10 AM
It is a known problem, download the Sandcastle Presentation File Patches here...

It fixed the problem.

Best regards,
Apr 15, 2008 at 3:36 PM
Unfortunaltly the problem still exists after Sandcastle Presentation File Patches.

Any other idea (I can send you the specific dll-file for analysing)?

Best regards,
Apr 15, 2008 at 4:08 PM
First, post some more of the log from a little before the error to the end. That will give us some more context with which to work and we may be able to see what is actually causing the problem if it isn't the same error. Also, let us know if you are using one of the community tools such as SHFB or DocProject. If it's a tool-specific error, it may not be Sandcastle's fault.

Apr 16, 2008 at 9:55 AM
Hi Eric,

I use SHFB, here the log-file from it:

Generating reflection information...
MrefBuilder (v2.4.10111.0)
Copyright ¸ Microsoft 2006
Info: Loaded 1 assemblies for reflection and 3 dependency assemblies.

Process is terminated due to StackOverflowException.
Last step completed in 00:00:12.5469

BUILD FAILED: Root element is missing.

Here the GenerateRefInfo.bat::


REM Step 1 - Generate the reflection information
"C:\Projekte\Condor5\Sandcastle\ProductionTools\MRefBuilder" /config:MRefBuilder.config / /dep:DLL\. *.dll *.exe

Here the MRefBuilder.config:

<platform version="2.0" path="%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\" />
<resolver type="Microsoft.Ddue.Tools.Reflection.AssemblyResolver" assembly="C:\Projekte\Condor5\Sandcastle\ProductionTools\MRefBuilder.exe" use-gac="false" />
<attributeFilter expose="true">
<!-- Most attributes in System.ComponentModel control designer behavior. Don't show them. -->
<!-- The exceptions are attributes relating to data binding. Do show them. -->
<namespace name="System.ComponentModel" expose="false">
<type name="BindableAttribute" expose="true"/>
<type name="ComplexBindingPropertiesAttribute" expose="true"/>
<type name="DataObjectAttribute" expose="true"/>
<type name="DefaultBindingPropertyAttribute" expose="true"/>
<type name="ListBindableAttribute" expose="true"/>
<type name="LookupBindingPropertiesAttribute" expose="true"/>
<type name="SettingsBindableAttribute" expose="true"/>
<type name="TypeConverterAttribute" expose="true"/>
<!-- These may provide useful information too -->
<type name="BrowsableAttribute" expose="true"/>
<type name="DefaultEventAttribute" expose="true"/>
<type name="DefaultPropertyAttribute" expose="true"/>
<type name="DefaultValueAttribute" expose="true"/>
<type name="DesignerSerializationVisibilityAttribute" expose="true"/>
<type name="EditorAttribute" expose="true"/>
<type name="EditorBrowsableAttribute" expose="true"/>
<type name="ExtenderProvidedProperty" expose="true"/>
<type name="ProvideProperty" expose="true"/>
<namespace name="System.ComponentModel.Design" expose="false" />
<!-- Most attributes in System.Diagnostics control debugger behavior. Don't show them. -->
<namespace name="System.Diagnostics" expose="false">
<type name="ConditionalAttribute" expose="true"/>
<type name="EventLogPermissionAttribute" expose="true"/>
<type name="PerformanceCounterPermissionAttribute" expose="true"/>
<!-- Attributes in System.Diagnostics.CodeAnalysis control interaction with FxCop. Don't show them. -->
<namespace name="System.Diagnostics.CodeAnalysis" expose="false" />
<!-- Attributes in System.EnterpriseServices control obscure details of COM+ interop. Don't show them. -->
<namespace name="System.EnterpriseServices" expose="false" />
<!-- The DefaultMember attribute is usually compiler-generated. Users will see it from the member syntax. -->
<namespace name="System.Reflection" expose="true">
<type name="DefaultMemberAttribute" expose="false" />
<!-- Attributes in System.Runtime.CompilerServices control obscure details of compilation. Don't show them. -->
<namespace name="System.Runtime.CompilerServices" expose="false" />
<!-- Attributes in System.Runtime.ConstrainedExecution control obscure details of compilation. Don't show them. -->
<namespace name="System.Runtime.ConstrainedExecution" expose="false" />
<!-- Most attributes in System.Runtime.InteropServices control obscure details of COM interop. Don't show them. -->
<namespace name="System.Runtime.InteropServices" expose="false">
<type name="ComVisibleAttribute" expose="true"/>
<type name="GuidAttribute" expose="true"/>
<type name="ClassInterfaceAttribute" expose="true"/>
<type name="InterfaceTypeAttribute" expose="true"/>
<!-- Attributes in System.Runtime.Versioning control details of resource loading. Don't show them. -->
<namespace name="System.Runtime.Versioning" expose="false" />
<!-- Attributes in System.Security might hint as security implementation details. Don't show them. -->
<namespace name="System.Security" expose="false">
<type name="AllowPartiallyTrustedCallersAttribute" expose="true" />
<!-- Attributes in System.Web.Compilation control interaction with the Expression designer. Don't show them. -->
<namespace name="System.Web.Compilation" expose="false" />
<!-- The ASP.NET team only wants these attributes exposed from their namespace. Their logic ecscapes me, but here it is. -->
<namespace name="System.Web.UI" expose="false">
<type name="ControlValuePropertyAttribute" expose="true"/>
<type name="ValidationPropertyAttribute" expose="true"/>
<type name="WebResourceAttribute" expose="true"/>
<type name="TemplateContainerAttribute" expose="true"/>
<type name="ThemeableAttribute" expose="true"/>
<type name="TemplateInstanceAttribute" expose="true"/>
<!-- Don't show attributes related to XAML serialization details. -->
<namespace name="System.Windows.Markup" expose="true">
<type name="ConstructorArgumentAttribute" expose="false" />
<type name="DependsOnAttribute" expose="false" />
<type name="DesignerSerializationOptionsAttribute" expose="false" />
<type name="ValueSerializerAttribute" expose="false" />
<type name="XmlnsCompatibleWithAttribute" expose="false" />
<type name="XmlnsDefinitionAttribute" expose="false" />
<type name="XmlnsPrefixAttribute" expose="false" />
<!-- Attributes in System.Xml.Serialization control obscure details of XML serialization. Don't show them.-->
<!-- namespace name="System.Xml.Serialization" expose="false" / -->
<apiFilter expose="true">
<namespace name="" expose="false"/>
<namespace name="MathNet.Numerics" expose="false"/>
<namespace name="Wintellect.PowerCollections" expose="false"/>


I hope that helps you to help me. As mentioned, I can send you the specific DLL involved.

Best regards

Apr 16, 2008 at 8:47 PM
MRefBuilder is failing with a stack overflow exception. Since that's a Sandcastle tool, there isn't anything I can do. I notice from the config file that you are excluding the MathNet.Numerics and Wintellect.PowerCollections namespaces. If these are just in assemblies that your project references, remove them from the Assemblies to Document list and add them to the Dependencies project property as that's where stuff you need referenced but don't need documented actually belongs. If either of those is causing the stack overflow problem, that might work around the issue.

You can open a work item reporting the bug. However, a new release should be coming out soon so your best chance of getting it fixed may be to report it directly to Anand via e-mail with a test case they can use to reproduce the problem (Aram at microsoft dot com).