Search code examples
c#visual-studiocomintellisensexml-documentation

Is it possible to augment Intellisense for a COM type library to display member summary descriptions?


I have a .NET 8.0, C# 12.0 Console App project that has a COM reference to the Adobe Illustrator 2024 Type Library. Member and parameter descriptions are not displayed in Intellisense tooltips for the objects exposed by this library. Is it possible to augment the project with a corresponding XML file containing the member description summaries?

I have long threads with both ChatGPT and Gemini trying to resolve this question with both AIs suggesting that it is indeed possible. However, nothing has worked so far. Hence, the question. Is this actually possible? If so, it would be a huge time-saver.

I created a stub documentation file, Interop.Illustrator.xml corresponding to the Interop.Illustrator.dll placed in the same output directory, \bin\Debug\net8.0-windows\Interop.Illustrator.dll. But Intellisense does not surface the descriptions. For example, at design-time, hovering over Application type in the Application app; declaration displays interface Illustrator.Application in the tooltip. And it displays {System._ComObject} at runtime while halted for debugging.

<?xml version="1.0" encoding="utf-8" ?>
<doc>
    <assembly>
        <name>Interop.Illustrator</name>
    </assembly>
    <members>
        <member name="T:Illustrator.Application">
            <summary>
                The Adobe® Illustrator® application object, referenced using the pre-defined global app object, which contains all other Illustrator objects.
            </summary>
        </member>
        <member name="P:Illustrator.Application.ActiveDocument">
            <summary>
                The active (frontmost) document in Illustrator.
            </summary>
        </member>
        </member>
    </members>
</doc>

Assembly, Interop.Illustrator, Application Decompiled

using System.Runtime.InteropServices;

namespace Illustrator;

[ComImport]
[CoClass(typeof(ApplicationClass))]
[Guid("95CD20AA-AD72-11D3-B086-0010A4F5C335")]
public interface Application : _Application {
}

Solution

  • Creating Interop.Illustrator.xml and copying it to the \obj\Debug\<TargetFramework>\Interop.Illustrator.xml folder (i.e., where the referenced type library's DLL, Interop.Illustrator.dll, is also copied) will get Intellisense working within the same project.

    Here's a documentation snippet:

    <?xml version="1.0" encoding="utf-8" ?>
    <doc>
        <assembly>
            <name>Interop.Illustrator</name>
        </assembly>
        <members>
            <member name="T:Illustrator.Application">
                <summary>
                    The Adobe® Illustrator® application object, referenced using the pre-defined global app object, which contains all other Illustrator objects.
                </summary>
            </member>
            <member name="P:Illustrator._Application.ActiveDocument">
                <summary>
                    The active (frontmost) document in Illustrator.
                </summary>
            </member>
            <member name="P:Illustrator._Application.BrowserAvailable">
                <summary>
                    If true, a web browser is available.
                </summary>
            </member>
        </members>
    </doc>
    ``