Silverlight MSDN links

Nov 30, 2009 at 3:31 PM

We're using Sandcastle (with SHFB) to generate our API doc for Silverlight. Since there is no Help2 version for the SL3 classes, we chose to reference the online MSDN topics instead. However, these links to point to the .NET 3.5 instead of the Silverlight API doc.

In the generated HTML, I can see that the MSDN links look like

<a href="" target="_blank">INotifyPropertyChanged</a>

which gets redirected to

while we'd like to have a link to

Is this possible somehow? (different Framework version configuration or something?)



Nov 30, 2009 at 8:54 PM

The links to the online content are produced by the MSDN web service.  As far as I know there is no way to control which framework the resulting target links point to.  If there is a way to tell the web service a preference, it would need to be exposed by modifying the existing Sandcastle ResolveReferenceLinksComponent2 build component.  Currently, it only accepts an option to specify the locale.



Mar 2, 2010 at 4:20 PM

Where is the ResolveReferenceLinksComponent2 component? - I'd like to try to make it resolve to Silverlight SDK references.



Mar 2, 2010 at 4:47 PM

You can download the source code for Sandcastle from this project site.  You'll find the code for it in there if you want to try to modify it.  You'll need the 21990 release if you want it to work with the current Sandcastle executables (May 2008 release).



Mar 2, 2010 at 6:16 PM
  1. I downloaded the latest source code
  2. I made the necessary changes to MsdnResolver.cs and ResolveReferenceLinksComponent2
  3. I rebuilt the dlls and exes
  4. I copied the dlls and exes to C:\Program Files (x86)\Sandcastle\ProductionTools

Now I get this error when I build:

Generating API filter for MRefBuilder...
    Last step completed in 00:00:00.0340
Generating reflection information...
  MrefBuilder (v2.5.10626.0)
  Copyright c Microsoft 2006
MREFBUILDER : error : The type 'Microsoft.Ddue.Tools.Reflection.AssemblyResolver' was not found in the component assembly 'C:\Program Files (x86)\Sandcastle\ProductionTools\MRefBuilder.exe'.
    Last step completed in 00:00:00.8959

SHFB: Error BE0043: Unexpected error detected in last build step.  See output above for details.

Any suggestions?

Mar 3, 2010 at 3:50 AM

You should probably just try replacing the assembly containing ResolveReferenceLinksComponent2 rather than all of the assemblies and executables.  A safer approach would be to create a custom component by cloning the code for just that component in a separate assembly and set it up as custom build component in SHFB that replaces the standard component (see Creating a Component Configuration File).  You can model the configuration for it after the CachedResolveReferenceLinksComponent that's supplied with SHFB since it acts as a replacement much like this one would.