Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NuGet package XML documentation not visible in .NET Core 2.2 app

I am using a NuGet package which has an XML documentation file.

But when I include the package in a .NET Core 2.2 app, the comments are not available with IntelliSense.

Is there something I'm missing either in the package or in my app to be able to see the documentation with IntelliSense?

Using VisualStudio 2017, Windows 10.

Update for Clarity

The NuGet package is a .NET Standard 1.3 class library. In Visual Studio when I build the project, I include the options to generate the package and documentation file. In the project file, I see the following PropertyGroup:

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
    <DocumentationFile>C:\Users\[username]\[local path]\CommonEntities\CommonEntities\CommonEntities.xml</DocumentationFile>
</PropertyGroup>

When I open the package, I can see in the lib/netstandard1.3/ directory that CommonEntities.xml is included along with MakanalTech.CommonEntities.dll.

But, I'm wondering why the xml file has dropped the full name from MakanalTech.CommonEntities.xml as it is in the project to just CommonEntities.xml in the package. Maybe this is the cause of the issue?

The issue is then when I include the package as a dependency in another project, none of the XML comments/documentation are visible. So I can't hover over a type to see its description, and if I peek definition none of the comments/documentation are in the definition.

Class Library Product https://imgur.com/zbE7ngM (can't post images yet)

Peeking at definition from other project: https://imgur.com/pwmvpX7

like image 638
kmcconnell Avatar asked Oct 19 '18 11:10

kmcconnell


1 Answers

Finally found the issue from this post. This seems quite buggy from Visual Studio 2017 not to handle this correctly and automatically.

In the .csproj file, I removed <DocumentationFile>[filepath-to-xml]</DocumentationFile> and added <GenerateDocumentationFile>true</GenerateDocumentationFile>.

I then repacked the library, cleared my nuget cache, and rebuilt the new project where it's included, and now I have all the XML documentation visible.

like image 126
kmcconnell Avatar answered Dec 08 '22 00:12

kmcconnell