This project has moved and is read-only. For the latest updates, please go here.

How to link to non-framework classes in MSDN?

Topics: User Forum
Jan 31, 2012 at 6:18 PM
Edited Jan 31, 2012 at 6:18 PM

When I create a website with Sandcastle it's not linking other non-framework classes from Microsoft, like ASP.NET MVC or Unity.

I've added the following targets to C:\Program Files (x86)\EWSoftware\Sandcastle Help File Builder\Templates\VS2005.config:

<targets base="c:\lib\aspnet-mvc-3.0\" recurse="true" files="*.xml" type="{@WebsiteSdkLinkType}" />
<targets base="c:\lib\unity-2.0\" recurse="true" files="*.xml" type="{@WebsiteSdkLinkType}" />

And the output shows them:

  Info: ResolveReferenceLinksComponent2: Searching directory 'c:\lib\aspnet-mvc-3.0' for targets files of the form '*.xml'.
  Info: ResolveReferenceLinksComponent2: Searching directory 'c:\lib\unity-2.0' for targets files of the form '*.xml'.
  Info: ResolveReferenceLinksComponent2: Loaded 202903 reference targets.

but it doesn't seem to do anything, it always shows 'Loaded 202903 reference targets'.

Jan 31, 2012 at 8:18 PM

Look further down in the log file. You'll probably find that the resolve reference links component is issuing warnings against those items saying it couldn't find them. It's quite likely that the component will need changing in order to tell the MSDN web service what it's looking for if the members are part of a library outside the standard .NET Framework assemblies.


Feb 1, 2012 at 4:19 PM

Any workarounds? Maybe edit some XSLT file and hardcode a link to{typename}, instead of just generating a span with a nolink class.

Feb 1, 2012 at 8:35 PM

If you're building a Help 2 or MS Help Viewer file, you can set the SDK link type properties to Index and Id respectively so that it generates local links.  They'll work by going to the locally installed content if its there rather than the online content.

However, it just occurred to me that what you did above won't work.  The XML files it needs are not the comments files but the reflection data files produced by running MRefBuilder on the assemblies and running the output through the doc model XSL transformations.  You may be able to get it to resolve the links by adding the Additional Reference Links plug-in to your main project which effectively does the above.  Create a separate project for the MVC and Unity assemblies and add them to it, then add that project to the plug-in configuration with the appropriate link type properties set to MSDN in the plug-in item configuration.  If the MSDN web service knows about the MVC and Unity types, it should then resolve them.  If not, it will take a change to the component to get it to resolve them.



Feb 1, 2012 at 10:27 PM

It worked! Thanks.