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

Problem with DocumentInternals, DocumentPrivateFields & DocumentPrivates

Topics: User Forum
Dec 15, 2006 at 9:08 AM

First of all I really think that Sandcastle Help File Builder is a very usefull tool.

But unfortunately, I have a problem. When I'm trying to generate a help file with the properties
DocumentInternals, DocumentPrivateFields and/of DocumentPrivates set to True I get an error of MrefBuilderStatic.
This error says that 'MrefBuilderStatic has encountered a problem and needs to close.'

This is a part of the output log:

Generating reflection information...
MrefBuilder (v2.2.61208.1447)
Copyright ¸ Microsoft 2006
Info: Loaded 11 assemblies for reflection and 0 dependency assemblies.

Unhandled Exception: System.InvalidOperationException: Unknown access level
at Microsoft.Ddue.Tools.ManagedReflectionWriter.GetVisibility(Member api)
at Microsoft.Ddue.Tools.ManagedReflectionWriter.WriteMemberData(Member member)
at Microsoft.Ddue.Tools.ManagedReflectionWriter.WriteMember(Member member, TypeNode type)
at Microsoft.Ddue.Tools.ManagedReflectionWriter.VisitMember(Member member)
at Microsoft.Ddue.Tools.Reflection.ApiVisitor.VisitMembers(MemberList members)
at Microsoft.Ddue.Tools.ManagedReflectionWriter.VisitType(TypeNode type)
at Microsoft.Ddue.Tools.Reflection.ApiVisitor.VisitTypes(TypeNodeList types)
at Microsoft.Ddue.Tools.ManagedReflectionWriter.VisitNamespace(Namespace space)
at Microsoft.Ddue.Tools.Reflection.ApiVisitor.VisitNamespaces(NamespaceList spaces)
at Microsoft.Ddue.Tools.ManagedReflectionWriter.VisitNamespaces(NamespaceList spaces)
at Microsoft.Ddue.Tools.Reflection.ApiVisitor.VisitApis()
at Microsoft.Ddue.Tools.MRefBuilder.Main(String[] args)

I hope there is a fix for this.

Thanks in advance,

Dec 15, 2006 at 4:05 PM
This appears to be a problem with Sandcastle itself. Report it in the MSDN Documentation Forum or by e-mailing

Dec 20, 2006 at 10:20 AM
Already found the reason of this error. In one of the internal classes there was a variable specified without a visibility level (public, protected, private or internal). This caused the crash of Sandcastle :)
Dec 20, 2006 at 5:33 PM
Interesting. I'd of thought it would have defaulted to private. I'd say it's still a bug in MRefBuilder as it should be able to handle it.

Jan 18, 2007 at 2:58 PM
I started seeing this error after upgrading to the December 2006 release; the previous version was fine. There are no unscoped variables as far as I can tell. I'm using VB and Framework 2.0.
Oct 27, 2008 at 4:42 AM
Edited Oct 27, 2008 at 4:53 AM

Waking this thread after a long sleep…

MrefBuilder /internal+ fails with Maartenvand's error on multiple third-party assemblies we use, including Microsoft.VisualBasic.PowerPacks.dll (assembly version, file version 3.0.30214.0).

Is there any way to stop SHFB from using /internal+ on specific assemblies? I only want to document my internals. 

Oct 27, 2008 at 5:14 PM

I replied as follows in the MSDN Documentation Forum:

Are you using the latest release of Sandcastle (May 2008, version 2.4.10520.1)?  I just tried MRefBuilder from the May 2008 release with /internal+ on the Power Pack assembly indicated and it worked fine.  The /internal+ option is part of MRefBuilder so it's an all or nothing option.  If you still have problems with it and the assemblies are dependencies, the only way around the problem is to not document the internals and privates.  If you do find a problem still exists, open a work item in the Sandcastle project (  If you're feeling ambitious, the source code to the Sandcastle tools is also available now at the same location.


Oct 27, 2008 at 9:36 PM
Edited Oct 27, 2008 at 11:41 PM

Thanks for that, Eric. I'll leave the MrefBuilder crash to the MSDN Documentation Forum, and raise a ticket in the Sandcastle tracker [Later: it's work item #2969 – Garth] regarding avoiding /internals+. 


Oct 31, 2008 at 2:59 AM
For a patched copy of MRefBuilder that fixes the issue, see this thread in the Sandcastle Discussions forum: