我读过指南here,但我找不到如何添加我生成的构建XML文档文件。我们曾经参考旧的.nuspec
文件<file></file>
标签中的文件,但我无法找到它的等价物。如何使用VS2017将文档添加到NuGet 4.x +包?
从我的理解看来,如果我在构建时创建了xml文件,它应该会自动添加到NuGet中,但是当我下载它后检查我的nuget时,它仍然没有xml文档。
我做错了什么?
编辑1
<PropertyGroup>
<VersionPrefix>1.0.5</VersionPrefix>
<PackageVersion>1.0.5</PackageVersion>
<TargetFrameworks>netcoreapp1.1;net461</TargetFrameworks>
<AssemblyName>SBTech.ApiUtils</AssemblyName>
<PackageId>SBTech.ApiUtils</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath>bin\Debug\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Dev|AnyCPU'">
<OutputPath>bin\Dev\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Staging|AnyCPU'">
<OutputPath>bin\Staging\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net461|AnyCPU'">
<DocumentationFile>bin\Debug\net461\SBTech.ApiUtils.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net461|AnyCPU'">
<DocumentationFile>bin\Release\net461\SBTech.ApiUtils.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Staging|net461|AnyCPU'">
<DocumentationFile>bin\Staging\net461\SBTech.ApiUtils.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Dev|net461|AnyCPU'">
<DocumentationFile>bin\Dev\net461\SBTech.ApiUtils.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netcoreapp1.1|AnyCPU'">
<DocumentationFile>bin\Debug\netcoreapp1.1\SBTech.ApiUtils.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netcoreapp1.1|AnyCPU'">
<DocumentationFile>bin\Release\netcoreapp1.1\SBTech.ApiUtils.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Staging|netcoreapp1.1|AnyCPU'">
<DocumentationFile>bin\Staging\netcoreapp1.1\SBTech.ApiUtils.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Dev|netcoreapp1.1|AnyCPU'">
<DocumentationFile>bin\Dev\netcoreapp1.1\SBTech.ApiUtils.xml</DocumentationFile>
</PropertyGroup>
这增加了XML文件到我的包,但是当我从客户端项目的XML文档中检查包装的代码是不是在VS.所示
怎么样这个问题?你能从马丁的回答中获得有用的信息吗?我测试它在我身边正常工作。如果它不是你想要的,请分享我们关于这个问题的更多信息。 –
事实上,我的VS是15.2版本,但升级后,问题仍然存在,我正在编辑我的项目文件的问题。 @ Leo-MSFT – kuskmen