MrefBuilder throwing Object reference not set error

Apr 9, 2009 at 3:23 PM

Im using SandcastleBuilder from CodePlex as a front end to sandcastle, but i have a project where the following error is being thrown in MrefBuilder. Any ideas as to what might cause this?

MrefBuilder (v2.4.10520.1)
Copyright c Microsoft 2006
Info: Loaded 41 assemblies for reflection and 42 dependency assemblies.

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Ddue.Tools.Reflection.NamespaceFilter.IsExposedNamespace(Namespace space)
   at Microsoft.Ddue.Tools.Reflection.NamespaceFilter.IsExposedType(TypeNode type)
   at Microsoft.Ddue.Tools.Reflection.RootFilter.HasExposedMembers(TypeNode type)
   at Microsoft.Ddue.Tools.Reflection.ApiFilter.HasExposedMembers(TypeNode type)
   at Microsoft.Ddue.Tools.Reflection.ApiFilter.NamespaceContainsExposedMembers(Namespace space)
   at Microsoft.Ddue.Tools.Reflection.ApiFilter.IsExposedNamespace(Namespace space)
   at Microsoft.Ddue.Tools.Reflection.ApiVisitor.VisitApis()
   at Microsoft.Ddue.Tools.MRefBuilder.Main(String[] args)
        1 file(s) copied.

Apr 9, 2009 at 8:30 PM
Are you using the APIFilter project property and/or <exclude /> tags in the XML comments?  Are you perhaps trying to document an obfuscated assembly?  MRefBuilder doesn't always handle obfuscated assemblies very well.  If you have any assemblies that are obfuscated, add them as dependent assemblies (SHFB 1.7) or references (SHFB 1.8).

Apr 14, 2009 at 8:31 PM
I'm not using any API filter (it is set to (none) in the dialog), but one thing i noticed is that the config file contains these lines near the bottom:

<apiFilter expose="true">
  <namespace name="" expose="false"/>
  <namespace name="Zywave.Elements.Components.SAL.Administration.Schemas" expose="false"/>
  <namespace name="Zywave.Elements.Components.SAL.Administration.ServiceContracts" expose="false"/>

which is weird to me considering I dont have any dlls in the document section or the dependencies section with those namespaces. I wonder if i should just recreate the entire help project file from scratch. maybe something is corrupted with it. i was kinda copying and pasting project files as i have 10+ of them but most of the settings are the same.
Apr 15, 2009 at 2:59 PM
ok nevermind. this was a corrupted help project file. I think from now on I'll just create help project files from scratch instead of copying an older one lol. as soon as i recreated the help project from scratch, it builds just fine.