Sandcastle is still failing on generic types parameters

Jun 14, 2011 at 8:44 PM
Edited Jun 15, 2011 at 3:20 PM

If method has at least one parameter of type Expression<Func<T, bool>> the Sandcastle fails on the whole method. It starts to complain that eveything is missing - Summary section, parameters description, etc. Even though they are all present.

I saw that similar bug was alredy reported a long time ago but it seems to be still in place. Taking it that the last release was almost a year ago, I am not sure whether this project is still supported? Is there any chance for this (pretty nasty) bug to be fixed soon?

And also I wanted to ask what is the possible workaround for this problem. Generic types are pretty common these days and could be seen almost in any code. So how do other code authors deal with this problem?

Jun 15, 2011 at 7:14 AM

Hello,

Please can you tell me more about this problem? I cannot reproduce it.

I have just tested it and it works fine, compiling it as .NET 3.5 assembly.

Take a look at this output

https://picasaweb.google.com/paulselormey/Temps#5618324159459635970

This my test class

using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

namespace TestLibrary
{
    /// <summary>
    /// For testing generic methods
    /// </summary>
    /// <typeparam name="T">A test type parameter.</typeparam>
    public class GenericMethods<T>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="GenericMethods{T}"/> class.
        /// </summary>
        public GenericMethods()
        {   
        }

        /// <summary>
        /// Testing generic expression.
        /// </summary>
        /// <param name="test">
        /// A test parameter.
        /// </param>
        public void Method1(Expression<Func<T, bool>> test)
        {   
        }
    }
}

Best regards,
Paul. 

Jun 15, 2011 at 3:47 PM

Thank you for the quick response.

In order to avoid any ambiguity I've copied your code without any changes into my solution and tried to build documentation on it.

This is what I've got:

[Missing <param name="test"/> documentation for "M:TestLibrary.GenericMethods`1.Method1(System.Linq.Expressions.Expression{System.Func`2})"]

This error message appears both within the generated help file and also in a build log.

Another symptom that I've noticed - the Method1 syntax appears in the generated help file as

public void Method1(Expression<Func> test)

whereas it should be

public void Method1(Expression<Func<T, bool>> test)

I am using .Net 4.0 and Visual Studio 2010 though, not .Net 3.5 . Also I am using  Sandacastle Help File Builder GUI, not Sandcastle directly from the command line.


Editor
Jun 15, 2011 at 4:00 PM

What version of SHFB?  There was a problem in earlier versions caused by it not passing the correct .NET Framework version to MRefBuilder for .NET 4.0 assemblies.  The latest stable release v1.9.3.0 fixed that issue.  Using it, you shouldn't see the problem.

Eric

 

Jun 15, 2011 at 8:10 PM

Thank you very much, Eric!

Downloading of  a newer release of SHFB really helped to resolve this problem.