GenerateDocumentationFile

GenerateDocumentationFile

本文介绍了在.NET Core 2.2应用程序中看不到NuGet包XML文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 NuGet软件包,该软件包具有 XML文档文件.

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

但是当我将包包含在 .NET Core 2.2应用中时, IntelliSense 中将不提供注释.

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

程序包或应用程序中是否缺少某些东西,以便能够使用IntelliSense查看文档?

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

使用 VisualStudio 2017,Windows 10 .

更新清晰度

NuGet程序包是一个 .NET Standard 1.3 类库.在生成项目时,在Visual Studio中,我包含用于生成程序包和文档文件的选项.在项目文件中,我看到以下PropertyGroup:

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>

当我打开软件包时,可以在 lib/netstandard1.3/目录中看到 CommonEntities.xml MakanalTech.CommonEntities一起包含在其中. dll .

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

但是,我想知道为什么xml文件将项目中的 MakanalTech.CommonEntities.xml 中的全名删除为 CommonEntities.xml 中的全名.包装.也许这是问题的原因?

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?

然后的问题是,当我将该软件包作为依赖项包含在另一个项目中时,所有XML注释/文档都不可见.因此,我无法将鼠标悬停在类型上以查看其描述,并且如果我偷看定义,则定义中不会包含任何注释/文档.

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.

类库产品 https://imgur.com/zbE7ngM (无法发布图片)

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

查看其他项目的定义: https://imgur.com/pwmvpX7

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

推荐答案

最后从帖子中找到了问题.从Visual Studio 2017来看,这似乎有很多错误,无法正确并自动进行处理.

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

在.csproj文件中,我删除了<DocumentationFile>[filepath-to-xml]</DocumentationFile>并添加了<GenerateDocumentationFile>true</GenerateDocumentationFile>.

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

然后我重新打包了该库,清除了我的nuget缓存,并重建了包含该库的新项目,现在我可以看到所有的XML文档.

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.

这篇关于在.NET Core 2.2应用程序中看不到NuGet包XML文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 03:03