XML-comments from an F# project are not showing up in a C# project when the function in question has out parameters.
Github-repo with reproduction https://github.com/viktorvan/FSharpXmlCommentBugRepro
Create a new F# class library dotnet new classlib --language "F#" -n FSharpProject
Add a type with xml-comments:
namespace FSharpProject
open System.Runtime.InteropServices //for OutAttribute
/// <summary>
/// This is my type
/// </summary>
type MyType() =
/// <summary>
/// This is a method with an out parameter
/// </summary>
/// <param name="s">An input string</param>
/// <param name="result">An output string</param>
static member StaticOutParam((s : string), [<Out>] result : string byref) =
result <- "test"
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Build the project and verify that xml-comments are generated correctly in /bin/Debug/netstandard2.0/FSharpProject.xml
At this point intellisense will work from within the F# project, or from another F# project referencing the original F#-project.
Create a new C# class library and reference the F# project. dotnet new classlib -n CSharpProject. dotnet add CSharpProject/CSharpProject.csproj reference FSharpProject/FSharpProject.fsproj
Add a class that uses the function from the F# project:
using FSharpProject;
namespace CSharpProject
{
public class Class1
{
public static void Test()
{
MyType.StaticOutParam("test", out var dummy);
}
}
}
Intellisense documentation is displayed when hovering the function in the C# project.
No intellisense documentation is shown.
None that I have found.
Provide any related information
This is the output XML documentation:
<?xml version="1.0" encoding="utf-8"?>
<doc>
<assembly><name>FSharpProject</name></assembly>
<members>
<member name="M:FSharpProject.MyType.StaticOutParam(System.String,Microsoft.FSharp.Core.byref{System.String,Microsoft.FSharp.Core.ByRefKinds.InOut})">
<summary>
This is a method with an out parameter
</summary>
<param name="s">An input string</param>
<param name="result">An output string</param>
</member>
</members>
</doc>
This is the documentation the C# compiler generates for the same class:
<?xml version="1.0"?>
<doc>
<assembly>
<name>CSharpProject</name>
</assembly>
<members>
<member name="M:CSharpProject.MyType.StaticOutParam(System.String,System.String@)">
<summary>
This is a method with an out parameter
</summary>
<param name="s">An input string.</param>
<param name="result">An output string</param>
</member>
</members>
</doc>
The type of the second parameter is different. The C# tooling probably looks for docs with the signature as seen in the second example.
BTW, it's the same the other way around:

Thanks, this should be an easy fix
Most helpful comment
This is the output XML documentation:
This is the documentation the C# compiler generates for the same class:
The type of the second parameter is different. The C# tooling probably looks for docs with the signature as seen in the second example.