2

I've made a nuget package containing a generated xml documentation file and published this package on a private repository.

Here is the .csproj of the nuget package.

<PropertyGroup>
    <TargetFramework>netstandard2.1</TargetFramework>
    <DocumentationFile>$(MSBuildProjectDirectory)\Test.xml</DocumentationFile>
    <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

<ItemGroup>
    <EmbeddedResource Include="Test.xml">
        <IncludeInPackage>true</IncludeInPackage>
        <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </EmbeddedResource>
</ItemGroup>

When I restore this packages on other machines using dotnet restore Another.Project.csproj, the package is restored correctly but the xml documentation file is missing.

I can see that the file lib/netcoreapp2.2/Test.xml exists inside %userprofile%\.nuget\packages\test\1.x.x\Test.1.x.x.nupkg.

But for some reasons it's not extracted to the %userprofile%\.nuget\packages\test\1.x.x\lib\netcoreapp2.2\ directory.

How can I make sure the xml resource file get extracted when I restore the package?


Notes

Justin Lessard
  • 10,804
  • 5
  • 49
  • 61
  • I was searching for the solution for the above question. @Justin Lessard - did you find any solution for this? Here is the question I asked but the command is being executed by team city - https://stackoverflow.com/questions/63747258/nuget-restore-is-ignoring-xml-files-but-downloading-only-dll-and-pdb-files?noredirect=1#comment112774651_63747258 – Vicky Sep 09 '20 at 00:26

0 Answers0