Object reference not set to an instance of an object.

Topics: Developer Forum, User Forum
Mar 30, 2007 at 2:29 AM
I'm getting the following error. I just installed the latest version of sandcastle and can't find mention of this in the docs:

Error: BuildAssembler: An error occured while initializing the build component 'SandcastleBuilder.Components.VersionInfoComponent' in the component assembly 'C:\Program Files\EWSoftware\Sandcastle Help File Builder\SandcastleBuilder.Components.dll'. The error message and stack trace follows: System.NullReferenceException: Object reference not set to an instance of an object.
at SandcastleBuilder.Components.VersionInfoComponent..ctor(BuildAssembler assembler, XPathNavigator configuration)
Last step completed in 00:00:32.2188

Full output:
C:\Program Files\Sandcastle\Presentation\Prototype\icons\pubmethod.gif -> C:\Program Files\Sandcastle\Examples\Sandcastle\Help\Working\Output\icons\pubmethod.gif
C:\Program Files\Sandcastle\Presentation\Prototype\icons\puboperator.gif -> C:\Program Files\Sandcastle\Examples\Sandcastle\Help\Working\Output\icons\puboperator.gif
C:\Program Files\Sandcastle\Presentation\Prototype\icons\pubproperty.gif -> C:\Program Files\Sandcastle\Examples\Sandcastle\Help\Working\Output\icons\pubproperty.gif
C:\Program Files\Sandcastle\Presentation\Prototype\icons\pubstructure.gif -> C:\Program Files\Sandcastle\Examples\Sandcastle\Help\Working\Output\icons\pubstructure.gif
C:\Program Files\Sandcastle\Presentation\Prototype\icons\security.gif -> C:\Program Files\Sandcastle\Examples\Sandcastle\Help\Working\Output\icons\security.gif
C:\Program Files\Sandcastle\Presentation\Prototype\icons\static.gif -> C:\Program Files\Sandcastle\Examples\Sandcastle\Help\Working\Output\icons\static.gif
C:\Program Files\Sandcastle\Presentation\Prototype\scripts\CollapsibleSection.js -> C:\Program Files\Sandcastle\Examples\Sandcastle\Help\Working\Output\scripts\CollapsibleSection.js
C:\Program Files\Sandcastle\Presentation\Prototype\scripts\CookieDataStore.js -> C:\Program Files\Sandcastle\Examples\Sandcastle\Help\Working\Output\scripts\CookieDataStore.js
C:\Program Files\Sandcastle\Presentation\Prototype\scripts\ElementCollection.js -> C:\Program Files\Sandcastle\Examples\Sandcastle\Help\Working\Output\scripts\ElementCollection.js
C:\Program Files\Sandcastle\Presentation\Prototype\scripts\EventUtilities.js -> C:\Program Files\Sandcastle\Examples\Sandcastle\Help\Working\Output\scripts\EventUtilities.js
C:\Program Files\Sandcastle\Presentation\Prototype\scripts\LanguageFilter.js -> C:\Program Files\Sandcastle\Examples\Sandcastle\Help\Working\Output\scripts\LanguageFilter.js
C:\Program Files\Sandcastle\Presentation\Prototype\scripts\MemberFilter.js -> C:\Program Files\Sandcastle\Examples\Sandcastle\Help\Working\Output\scripts\MemberFilter.js
C:\Program Files\Sandcastle\Presentation\Prototype\scripts\SplitScreen.js -> C:\Program Files\Sandcastle\Examples\Sandcastle\Help\Working\Output\scripts\SplitScreen.js
C:\Program Files\Sandcastle\Presentation\Prototype\scripts\StyleUtilities.js -> C:\Program Files\Sandcastle\Examples\Sandcastle\Help\Working\Output\scripts\StyleUtilities.js
C:\Program Files\Sandcastle\Presentation\Prototype\styles\presentation.css -> C:\Program Files\Sandcastle\Examples\Sandcastle\Help\Working\Output\styles\presentation.css
Last step completed in 00:00:00.4688

Building help topics...
C:\Program Files\Sandcastle\Examples\Sandcastle\Help\Working\BuildHelpTopics.bat
BuildAssembler (v2.2.63000.2)
Copyright c Microsoft 2006
Info: CopyFromFileComponent: Instantiating component.
Info: CopyFromFileComponent: Loading data file 'C:\Program Files\Sandcastle\Presentation\Prototype\transforms\skeleton.xml'.
Info: CopyFromIndexComponent: Instantiating component.
Info: CopyFromIndexComponent: Searching for files that match 'reflection.xml'.
Info: CopyFromIndexComponent: Searching for files that match 'C:\Program Files\Sandcastle\Data\Cpref_reflection\*.xml'.
Info: CopyFromIndexComponent: Indexed 149244 elements in 105 files.
Info: CopyFromIndexComponent: Instantiating component.
Info: ForEachComponent: Instantiating component.
Info: ForEachComponent: Loading subcomponents.
Info: CopyFromIndexComponent: Instantiating component.
Info: ForEachComponent: Loaded 1 subcomponents.
Info: ForEachComponent: Instantiating component.
Info: ForEachComponent: Loading subcomponents.
Info: CopyFromIndexComponent: Instantiating component.
Info: ForEachComponent: Loaded 1 subcomponents.
Info: IfThenComponent: Instantiating component.
Info: SyntaxComponent: Instantiating component.
Info: SyntaxComponent: Loaded 3 syntax generators.
Info: CopyFromIndexComponent: Instantiating component.
Info: CopyFromIndexComponent: Searching for files that match 'C:\Program Files\Sandcastle\Examples\Sandcastle\Help\Working\modelBaseforSandcastle.xml'.
Info: CopyFromIndexComponent: Searching for files that match 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\*.xml'.
Info: CopyFromIndexComponent: Indexed 75463 elements in 66 files.
Info: ForEachComponent: Instantiating component.
Info: ForEachComponent: Loading subcomponents.
Info: IfThenComponent: Instantiating component.
Info: CopyFromIndexComponent: Instantiating component.
Info: CopyFromIndexComponent: Instantiating component.
Info: ForEachComponent: Loaded 2 subcomponents.
Info: CopyFromIndexComponent: Instantiating component.
Info: ShowMissingComponent: Instantiating component.
Info: ShowMissingComponent:
Sandcastle Help File Builder Components, version 1.4.0.1
Show Missing Documentation Component. Copyright c 2006-2007, Eric Woodruff, All Rights Reserved
http://www.codeplex.com/SHFB
Info: VersionInfoComponent: Instantiating component.
Info: VersionInfoComponent:
Sandcastle Help File Builder Components, version 1.4.0.1
Version Information Component. Copyright c 2006-2007, Eric Woodruff, All Rights Reserved
http://www.codeplex.com/SHFB
Error: BuildAssembler: An error occured while initializing the build component 'SandcastleBuilder.Components.VersionInfoComponent' in the component assembly 'C:\Program Files\EWSoftware\Sandcastle Help File Builder\SandcastleBuilder.Components.dll'. The error message and stack trace follows: System.NullReferenceException: Object reference not set to an instance of an object.
at SandcastleBuilder.Components.VersionInfoComponent..ctor(BuildAssembler assembler, XPathNavigator configuration)
Last step completed in 00:00:32.2188


BUILD FAILED: Unexpected error in last build step. See output above for details.

BUILD FAILED: Unexpected error in last build step.
Coordinator
Mar 30, 2007 at 3:00 PM
Check further back in the log for other errors or problems. Make sure that MRefBuilder actually output something (i.e. you declared some public types). If you can find anything, please send me the content of the .\Working folder and I'll look into it. You can leave out the assemblies if you don't want to send them. My e-mail address is in the About box and the footer of the help pages.

Eric
Apr 7, 2007 at 12:26 PM
Hi, any new insights concerning this matter?
Sadly I have the same problem. Until now the build succeeded not a single time.
I'm sending you the contents of the Working folder.

Marcus

Apr 8, 2007 at 10:47 PM
Hi Eric,

I may have solved the first problem, but am still getting build errors.

Sandcastle Help File Builder GUI, version 1.4.0.1
Creating output and working folders...
Clearing working folder...
Finding tools...
Found Sandcastle in 'C:\Program Files\Sandcastle\'
Found HTML 1.x help compiler in 'C:\Program Files\HTML Help Workshop\'
Validating documentation assembly information...
-------------------------------
Creating Sandcastle configuration file...
Last step completed in 00:00:00.0625
-------------------------------
Generating shared content files (en-US)...
Last step completed in 00:00:00.0938
-------------------------------
Generating reflection information...
C:\Program Files\Sandcastle\Examples\Sandcastle\Help\Working\GenerateRefInfo.bat
MrefBuilder (v2.2.63000.2)
Copyright c Microsoft 2006
Error: Unresolved assembly reference: Citigroup.ASAP.Ventana.Framework (Citigroup.ASAP.Ventana.Framework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) required by Citigroup.ASAP.Ventana.Models
Last step completed in 00:00:00.7031


BUILD FAILED: Unexpected error in last build step. See output above for details.


So I looked up the help info about unresolved dependencies and added "Citigroup.ASAP.Ventana.Framework.dll" --which seemed to be what is shown in the example and what the error log above? But I'm still getting the following error:

Sandcastle Help File Builder GUI, version 1.4.0.1
Creating output and working folders...
Clearing working folder...
Finding tools...
Found Sandcastle in 'C:\Program Files\Sandcastle\'
Found HTML 1.x help compiler in 'C:\Program Files\HTML Help Workshop\'
Validating documentation assembly information...
-------------------------------
Creating Sandcastle configuration file...
Last step completed in 00:00:00.0156
-------------------------------
Generating shared content files (en-US)...
-------------------------------
Copying document assembly dependencies...
C:\Ventana\Citigroup.ASAP.Ventana.Framework\bin\Debug\Citigroup.ASAP.Ventana.Framework.dll.config -> C:\Program Files\Sandcastle\Examples\Sandcastle\Help\Working\DLL\Citigroup.ASAP.Ventana.Framework.dll.config
Last step completed in 00:00:00.0781
-------------------------------
Generating reflection information...
C:\Program Files\Sandcastle\Examples\Sandcastle\Help\Working\GenerateRefInfo.bat
MrefBuilder (v2.2.63000.2)
Copyright c Microsoft 2006
Error: Unresolved assembly reference: Citigroup.ASAP.Ventana.Framework (Citigroup.ASAP.Ventana.Framework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) required by Citigroup.ASAP.Ventana.Models
Last step completed in 00:00:00.7500

Can you tell me what is wrong?
Apr 9, 2007 at 8:26 PM
Hi Christina,

how did you solve the first problem?

Marcus
Apr 9, 2007 at 8:40 PM
Hi Marcus,

I wish I could tell you. I'm just got a new build and when I ran it got different errors on Sandcastle. Haven't had time to check further into it.

Christina
Coordinator
Apr 11, 2007 at 1:24 AM
Your current "missing dependency" problem is because you've added a ".config" file as the assembly rather than the assembly itself. Edit the entry and remove the ".config" extension to point it at the actual DLL and it should build.

Eric
Apr 11, 2007 at 5:02 PM
Hi all,

even my first problem seems to be solved. How? I don't know!
When I ran the build today it worked. I didn't change anything.
Mysterious, mysterious.

Another point: During the build the BuildAssembler tries to access the internet.
If I deny this wish I get the following error:
...
Info: ResolveReferenceLinksComponent: Preparing to query MSDN topic URL web service.
Error: ResolveReferenceLinksComponent: An error occured while attempting to query the MSDN topic URL web service. The error message is: The remote name could not be resolved: 'services.msdn.microsoft.com'
Last step completed in 00:00:59.4531


BUILD FAILED: Unexpected error in last build step. See output above for details.

Whose fault? Sandcastle? HelpFileBuilder?
Maybe the handling could be a bit more elegant.

Marcus
Coordinator
Apr 11, 2007 at 7:04 PM
Edited Apr 11, 2007 at 7:05 PM
It's the ResolveReferenceLinks component. You can set the SdkLinkType property to None to prevent this. See the FAQ for information.

Eric
Apr 12, 2007 at 6:20 PM
Hi Eric,

you're right. I should have read the docu first before making any "suggestions".
But I want to let you know that I really, really appreciate your work.

Marcus