Skip to content

XML documentation issues with C++/CLI code which uses "const" #2728

Description

@Dwedit

Input code

This code is correctly decompiled, but the XML documentation is missing.

This is C++/CLI code:

/// <summary>
/// Example Class
/// </summary>
public ref class Example
{
public:
	/// <summary>
	/// Hello Function
	/// </summary>
	/// <param name="param1">Parameter 1</param>
	/// <returns>value of param1</returns>
	static int Hello(const int param1)
	{
		return param1;
	}
};

Due to using the "const" keyword on the first parameter, the XML file contains something rarely seen, and this may be throwing off ILSpy:

<member name="M:Example.Hello(System.Int32!System.Runtime.CompilerServices.IsConst)">

If I remove the part !System.Runtime.CompilerServices.IsConst, then it will output the XML documentation properly.

A preconfigured Visual Studio project to build the example is available here: https://www.dwedit.org/files/.ilspy/DummyProject4.7z

edit:

It also appears that char* is repesented in the XML as System.SByte!System.Runtime.CompilerServices.IsSignUnspecifiedByte*.

Erroneous output

XML documentation is missing because "!System.Runtime.CompilerServices.IsConst" is appended to the type name, and ILSpy is unable to handle that.

Details

  • Product in use: ILSpy
  • Version in use: 7.2.1.6856

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions