Problems with the new release

Topics: User Forum
Jan 6, 2010 at 8:33 AM

Just upgraded to the new version and now have the following warning: SHFB : warning BHT0001: Unable to get executing project: Unable to obtain internal reference.

I am using MSBuild 4.0 and calling SHFB with the following call:


SHFB is not installed and I would like to pass the SHFBROOT as a property to this.  I can get it to build another way by modifying the .targets file to set the root, but this does not help with the above warning.  Do I have to set a MSBUild Project property anywhere?


The new version also occationally gives us an Unhandled Exception: OutOfMemoryException. which of course is strange.  BuildReferenceTopics.proj(27,5): error MSB6006: &quot;BuildAssembler.exe&quot; exited with code -532459699.


I have also tried to use MRefBuilder with the V4.0 libraries and this also does not work with Beta2 of .NET V4.0.  MRefBuilder crashes on the System.Core.dll with the following error:

Unhandled Exception: System.Resources.MissingManifestResourceException: Could not find any resources appropriate for the specified culture or the neutral culture.  Make sure "CCI.ExceptionStrings.resources" was correctly embedded or linked into assembly "MrefBuilder" at compile time, or that all the satellite assemblies required are loadable and fully signed.


Has anyone else experienced these problems too?

Jan 6, 2010 at 3:12 PM
Edited Jan 6, 2010 at 3:12 PM

SHFB was built against and references the MSBuild 3.5 assemblies so you must use MSBuild 3.5 to build its projects.  It will correctly handle documenting an assembly built with any version of the framework from .NET 1.1 through .NET 4.0 since that part is independent of SHFB.  However, you do need to create an MRefBuilder.exe.config file that lets the MRefBuilder tool know what supported runtimes are available to use.  You can download and apply the latest Sandcastle Styles patch to the May 2008 release of Sandcastle.  The patch includes the config file and it will work with .NET 4.0 executables.  The patch also includes the necessary updated transformations and resource items for the F# syntax sections and MS Help Viewer metadata.



Jan 7, 2010 at 8:01 AM
Edited Jan 7, 2010 at 12:57 PM

Thanks for the reply Eric,.  However, I did all this before the above problems appeared,  So these problems are unrelated to the MrefBuilder.exe.config file.  The MRefBuilder does a fine job until System.Core.dll (V4.0) then dies.  I have switched back to using only V3.5 assemblies.

Could you help with the other problems?  The SHFB : warning BHT0001: Unable to get executing project: Unable to obtain internal reference. warning is the most frustrating.  I cannot find what I am doing wrong as this happens even when I run it from the command line.  Does my MSBuild file have to end in .proj?

I also had this error with the previous versions of Sandcastle Help File Builder!


Jan 7, 2010 at 3:39 PM

Your original post says you are using MSBuild 4.0.  Even if you're using an MSBuild task to run the SHFB project, I'm pretty sure it's still going to use the MSBuild version used to invoke the parent project for the sub-task.  As I said, SHFB is built with MSBuild 3.5 so you need to use that version to build the project (C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe).  If running it as a sub-task within a parent project, you need to use it on the parent project too.  If that isn't possible, you'll need to build the SHFB project separately.  Since it's still in beta and requires a separate build of SHFB, I haven't looked into supporting MSBuild 4.0 in the build tasks yet.

Regarding MRefBuilder, VS 2010 Beta 2 updated the .NET 4.0 version number so you may need to add it to the MRefBuilder.exe.config file (<supportedRuntime version="v4.0.21006"/> <!-- 4.0 Beta installed by VS2010 Beta 2 -->).