我讀過指南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