enum parameter with Func delegate shown as System.void or System.String

Topics: Developer Forum, User Forum
Oct 19, 2010 at 5:33 AM
Edited Oct 19, 2010 at 5:43 AM

I've been documenting c# project(.net 4.0) with SHFB.

Sandcastle documented greatly except some generic methods and method which has not only Func also enum parameters.

I was able to fix one of the problems with generic method by modifying method signature in a project's xml file to match a method signature the Sandcastle holds. 

In the other problem, I still don’t know How to fix.

Regarding my test, it goes well if method only has enum parameters. but if  it has both types of parameters( Func, enum)

document shows an following error message.

[Missing <summary> documentation for "M:SandcastleProblems.Demonstration.Log(System.Func`1,System.Void,System.String)"]

Void? String? It seems that Sandcastle holds wrong information.

Any suggestions will be appreciated.

It is my test code below.

Example Code:

 

        /// <summary>
        /// Log method 1. This method goes well into a document.
        /// </summary>
        /// <param name="category">First enum.</param>
        /// <param name="priority">Second enum.</param>
        public void Log(Category category, Priority priority)
        {
            System.Diagnostics.Debug.WriteLine(string.Format("Category : {1}, Priority : {2}", category, priority));
        }

        /// <summary>
        /// Sandcastle will show an following error message for this method.
        /// [Missing &lt;summary&gt; documentation for "M:SandcastleProblems.Demonstration.Log(System.Func`1,System.Void,System.String)"]
        /// </summary>
        /// <param name="message">Func delegate which returns message to log.</param>
        /// <param name="category">First enum.</param>
        /// <param name="priority">Second enum.</param>
        public void Log(Func<string> message, Category category, Priority priority)
        {
            System.Diagnostics.Debug.WriteLine(string.Format("Message : {0}, Category : {1}, Priority : {2}", message(), category, priority));
        }

    /// <summary>
    /// Category Enum.
    /// </summary>
    public enum Category
    { 
        /// <summary>
        /// Member A
        /// </summary>
        A,
        /// <summary>
        /// Member B
        /// </summary>
        B,
        /// <summary>
        /// Member C
        /// </summary>
        C
    }

    /// <summary>
    /// Priority Enum.
    /// </summary>
    public enum Priority
    {
        /// <summary>
        /// Member A
        /// </summary>
        A,
        /// <summary>
        /// Member B
        /// </summary>
        B,
        /// <summary>
        /// Member C
        /// </summary>
        C
    }
 
Coordinator
Oct 21, 2010 at 8:21 PM

This is most likely a bug in MRefBuilder.  I'll take a look when I get some time.  If so, I doubt there's a workaround for it.  You can turn off the missing element warnings so that they don't appear in the help file though.

Eric

 

Dec 23, 2010 at 9:24 PM

Same problem here...

Coordinator
Feb 6, 2012 at 8:55 PM

In reviewing the bug reports, I ran across this one again.  It turns out this is not a bug in MRefBuilder but was a problem with the way SHFB used to specify the framework folder with .NET 4.0 assemblies.  It was subsequently fixed and isn't an issue with v1.9.3.0 or later.  If you do encounter this issue, make sure the FrameworkVersion project property is set to the proper value that matches the version used by your assembly.

Eric