fail to generate helps for C++/CLI generic arguments

Sep 7, 2011 at 10:19 PM

Hello,

I'm using SHFB 1.9.3 and Sancastle 2.6.10621.1. When I tried to generate the help file from my C++/CLI project built in VS2010 (.NET 4), it seemed that all descriptions for the methods with generic arguments are gone and I got missing entities. Here is my test code:

Header file:

#pragma once

using namespace System::Collections::Generic;

namespace CLIDocTest {
	public ref class Test
	{
	public:
		///<summary>Constructor</summary>
		Test(void);

		///<summary>Write method</summary>
		///<param name="input">test</param>
		void Write(List<int> input);
		
	};
}
 
Source file:
namespace CLIDocTest
{
	Test::Test(void)
	{
	}

	void Test::Write(List<int> input)
	{
	}
}

The errors I got are the following:

[Missing <summary> documentation for "M:CLIDocTest.Test.Write(System.Collections.Generic.List{System.Int32}|System.Runtime.CompilerServices.IsByValue)"]

and

Parameters
input
Type: System.Collections.Generic.List(Int32)

[Missing <param name="input"/> documentation for "M:CLIDocTest.Test.Write(System.Collections.Generic.List{System.Int32}|System.Runtime.CompilerServices.IsByValue)"]

Is there any issue on C++/CLI? I saw another thread about a similar issue on C# but it was fixed in SHFB 1.9.3.

Thanks.

Editor
Sep 8, 2011 at 3:09 AM

The C++ compiler doesn't always generate the same method signatures in the XML comments that MRefBuilder generates for the reflection information so the XML comments may fail to match up.  You can try setting the SHFB project option CppCommentsFixup to true to see if it resolves the issue.  It should fix it for most cases though I think there may be a few were it doesn't.  Also, be sure you've got the FrameworkVersion property set to .NET 4.0 since using an earlier version with a .NET 4.0 assembly causes a separate issue which was the problem with earlier versions of SHFB you referenced.

Eric

 

Sep 8, 2011 at 3:17 AM

>>Eric: ..CppCommentsFixup to true to see if it resolves the issue.

The generated output adding !System.Runtime.CompilerServices.IsByValue is new to me and
I am also investigating that right now.

Setting CppCommentsFixup to true will not resolve it, and .NET 4 has no effect on it, since the same
compiles under both .NET 3.5/4.0, and both VS.NET 2008 and 2010 generate the same comment output. 

Best regards,
Paul. 

Sep 8, 2011 at 4:05 AM

To the original poster do you mean to write 

Write(List<int>^ input) or Write(List<int> input)

Best regards,
Paul. 

Sep 8, 2011 at 4:25 AM

What I meant is Write(List<int>^ input). I was creating a quick test project and got this typo. The error I got after fixing this typo is:

[Missing <summary> documentation for "M:CLIDocTest.Test.Write(System.Collections.Generic.List{System.Int32})"]

Parameters

input
Type: System.Collections.Generic.List(Int32)

[Missing <param name="input"/> documentation for "M:CLIDocTest.Test.Write(System.Collections.Generic.List{System.Int32})"]

Simply without IsByValue. My original project is way bigger than this small test, and I'm seeing the same error as long as the argument is generic.

Sorry about the confusion.

 

Best,

Sean

Sep 8, 2011 at 4:27 AM

Then it can be fixed by setting the CppCommentsFixup to true.

Best regards,
Paul. 

Sep 8, 2011 at 4:35 AM

I'm still seeing the same error after setting CppCommentsFixup to true.

Sep 8, 2011 at 4:41 AM

I have just verified that it fixes it. Clean your C++ Project and try again.
I can post a screenshot if you are in doubt. 

Best regards,
Paul. 

Sep 8, 2011 at 4:44 AM

Thanks, Paul. I tried my original project and it works fine. There may be some configuration errors in this simple test project. Really appreciate your help.

Best regards,

Sean