Silverlight MSDN links

Nov 30, 2009 at 2: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="http://msdn2.microsoft.com/en-us/library/ms133020" target="_blank">INotifyPropertyChanged</a>

which gets redirected to

http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged.aspx

while we'd like to have a link to

http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged(VS.95).aspx

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

Regards

JM

Editor
Nov 30, 2009 at 7: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.

Eric

 

Mar 2, 2010 at 3:20 PM

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

Thanks,

Michael

Editor
Mar 2, 2010 at 3: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).

Eric

 

Mar 2, 2010 at 5: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...
[C:\Windows\Microsoft.NET\Framework64\v3.5\MSBuild.exe]
GenerateRefInfo:
  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?

Editor
Mar 3, 2010 at 2: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.

Eric