No help generated for .NET 4.0 assemblies if members contain 4.0 types in signature

Topics: User Forum
May 16, 2010 at 11:31 PM

Hi,

I'm trying to generate a .chm help file using SHFB for a .NET 4.0 (RTM build 30319) assembly. Help gets generated correctly for the following class:

 

    /// <summary>
    /// This is a simple class.
    /// </summary>
    public class SimpleClass
    {
        /// <summary>
        /// Simple method
        /// </summary>
        /// <param name="value">Some parameter</param>
        public void SimpleMethod(int value)
        { 
        }
    }

However, as soon as one member of the class uses a .NET 4.0 type (e.g. Task, Tuple<>, CancellationTokenSource, etc.), the following happens: Changing the snippet above to

    /// <summary>
    /// This is a simple class.
    /// </summary>
    public class SimpleClass
    {
        /// <summary>
        /// My property
        /// </summary>
        public int MyProperty { get; set; }

        /// <summary>
        /// Simple method
        /// </summary>
        /// <param name="value">Some parameter</param>
        public void SimpleMethod(Task value)
        { 
        }
    }

(notice the type of parameter "value" was changed from "int" to "Task")

- The .chm file still contains help pages for all members (SimpleClass, MyProperty, SimpleMethod)

- However, the TOC of the .chm file doesn't include any member of SimpleClass (i.e. only SimpleClass is listed with inherited methods like ToString() etc.). I.e. you can only see help pages for SimpleMethod if you search for it in the .chm file. But the overview page for SimpleClass doesn't show SimpleMethod.

 

I think I narrowed the issue down to the step where the TOC files are generated (I believe by executing XslTransform.exe).

Was anyone able to generate help files for .NET 4.0 assemblies containing any new NET 4.0 types? Are there any known workarounds?

 

Thanks,
Alexander

Coordinator
May 17, 2010 at 4:10 PM

This is a known issue with MRefBuilder.exe and .NET 4.0 assemblies. It has been reported that it is fixed in the next release of Sandcastle due out some time next month.

Eric

 

May 20, 2010 at 6:17 AM
Is the error below caused by the same problem? MREFBUILDER : error : Unresolved assembly reference: System.Xml (System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) required by xxx I've just upgraded from Sandcastle 1.6 to the latest version and my solution now targets .NET 4.0 (previously 2.0). Are there any work arounds for this error? thanks Sam
Coordinator
May 20, 2010 at 4:08 PM

Download and apply the Sandcastle Styles patch and then update the C:\Program Files\Sandcastle\ProductionTools\MRefBuilder.exe.config file to include a supportedRuntime element for the .NET 4.0 RTM version number.

Eric

 

May 20, 2010 at 5:29 PM

I applied the Sandcastle Styles as Eric suggested and it works fine as long as your APIs don't use any 4.0 types (e.g. Task, CancellationToken, etc.).

I'm looking forward to the next release of Sandcastle next month. Thanks Eric for your prompt replies.

May 21, 2010 at 12:04 AM
All working now :) Eric, many thanks for the quick response. Sam