C# 如何将文档添加到NuGet 4.x+;使用VS2017的软件包?

C# 如何将文档添加到NuGet 4.x+;使用VS2017的软件包?,c#,.net,nuget,visual-studio-2017,C#,.net,Nuget,Visual Studio 2017,我已经阅读了指南,但找不到如何添加生成的on-build xml文档文件。我们过去常常引用旧.nuspec文件标签中的文件,但我找不到与之等效的文件 据我所知,如果我在构建时创建xml文件,它应该自动添加到NuGet中,但当我在下载后检查NuGet时,它仍然没有xml文档 我做错了什么 编辑1 <PropertyGroup> <VersionPrefix>1.0.5</VersionPrefix> <PackageVersion>

我已经阅读了指南,但找不到如何添加生成的on-build xml文档文件。我们过去常常引用旧
.nuspec
文件
标签中的文件,但我找不到与之等效的文件

据我所知,如果我在构建时创建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>

1.0.5
1.0.5
netcoreapp1.1;net461
小蜜蜂
小蜜蜂
假的
假的
假的
bin\Debug\
bin\Dev\
bin\Staging\
bin\Release\
bin\Debug\net461\SBTech.ApiUtils.xml
bin\Release\net461\SBTech.ApiUtils.xml
bin\Staging\net461\SBTech.ApiUtils.xml
bin\Dev\net461\SBTech.ApiUtils.xml
bin\Debug\netcoreapp1.1\SBTech.ApiUtils.xml
bin\Release\netcoreapp1.1\SBTech.ApiUtils.xml
bin\Staging\netcoreapp1.1\SBTech.ApiUtils.xml
bin\Dev\netcoreapp1.1\SBTech.ApiUtils.xml

这会将xml文件添加到我的包中,但是,当我从客户端项目中检查包的代码时,更新到VS 2017版本15.3或更高版本和.NET Core 2.0.0 SDK(“CLI”)后,xml文档不会显示在VS中-或macOS/linux上的mono 5.2-一旦
csproj
设置为生成xml文档(通过
GenerateDocumentationFile
属性设置为
true
),这将自动完成


具体来说,NuGet 4.3.0已经解决了这个问题,这个问题怎么办?你能从马丁的回答中得到有用的信息吗?我测试它在我这边运行良好。如果这不是你想要的,请与我们分享更多关于这个问题的信息。事实上,我的VS是15.2版本,但升级后,问题仍然存在,我正在用我的项目文件编辑我的问题@Leo MSFTI编辑了我的问题,我认为我做了一些其他错误的事情,因为我将我的工作室从15.2更新到15.3,问题仍然存在。我测试了它,当我创建一个具有您的属性的项目时,它工作得很好。您是否安装了2.0.0 SDK,并确保没有设置较低SDK版本的
global.json