You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When publishing a WebApi that references a dependency NuGet package, the XML comment files for dependency packages are not copied to the Publish folder.
This happens in the official Microsoft Docker builds.
FROM microsoft/dotnet:2.1-sdk AS build-env
ARG VERSION
WORKDIR /app
COPY . ./
RUN dotnet restore
RUN dotnet publish /p:Version=${VERSION} -c Release -o out
RUN ls -lR ~/.nuget/packages
RUN ls -lR /app/customer/out
The NuGet cache folder contains the following for the dependency package, notice the XML is not extracted.
/root/.nuget/packages/tp.net.core:
total 0
drwxr-xr-x. 3 root root 117 Feb 15 13:48 1.0.82
/root/.nuget/packages/tp.net.core/1.0.82:
total 288
-rw-r--r--. 1 root root 281585 Feb 15 13:48 tp.net.core.1.0.82.nupkg
-rw-r--r--. 1 root root 88 Feb 15 13:48 tp.net.core.1.0.82.nupkg.sha512
-rwxrw-rw-. 1 root root 4447 Feb 14 14:59 tp.net.core.nuspec
drwxr-xr-x. 3 root root 28 Feb 15 13:48 lib
/root/.nuget/packages/tp.net.core/1.0.82/lib:
total 0
drwxr-xr-x. 2 root root 54 Feb 15 13:48 netstandard2.0
/root/.nuget/packages/tp.net.core/1.0.82/lib/netstandard2.0:
total 624
-rwxrw-rw-. 1 root root 460800 Feb 14 14:59 TP.Net.Core.dll
-rwxrw-rw-. 1 root root 173892 Feb 14 14:59 TP.Net.Core.pdb
/app/customer/out only contains the DLL and the PDB
I tried microsoft/dotnet:2.1-sdk, microsoft/dotnet:2.1-sdk-alpine, microsoft/dotnet:2.2-sdk, all showed the same behaviour.
Publishing from a Windows Desktop, or MacOs desktop gets the correct result, with the dependency package's XML file extracted and copied into the publish folder
Publish the project in Visual Studio/Rider/VsCode, the XML file for the class lib is published
Build the project using Docker.
FROM microsoft/dotnet:2.1-sdk AS build-env
ARG VERSION
WORKDIR /app
COPY . ./
RUN dotnet publish /p:Version=${VERSION} -c Release -o out
FROM microsoft/dotnet:2.1-aspnetcore-runtime
WORKDIR /
COPY --from=build-env /app/customer/out .
ENTRYPOINT ["dotnet", "customer.dll"]
Examine the image, notice the XML file for the class library is missing
Details about Problem
When publishing a WebApi that references a dependency NuGet package, the XML comment files for dependency packages are not copied to the Publish folder.
This happens in the official Microsoft Docker builds.
The NuGet cache folder contains the following for the dependency package, notice the XML is not extracted.
/app/customer/out only contains the DLL and the PDB
I tried microsoft/dotnet:2.1-sdk, microsoft/dotnet:2.1-sdk-alpine, microsoft/dotnet:2.2-sdk, all showed the same behaviour.
Publishing from a Windows Desktop, or MacOs desktop gets the correct result, with the dependency package's XML file extracted and copied into the publish folder
Contents of the nupkg
NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe):
dotnet.exe
NuGet version (x.x.x.xxx):
dotnet nuget --version
NuGet Command Line
4.8.1.0
dotnet.exe --version (if appropriate):
dotnet --version
2.1.403
VS version (if appropriate):
OS version (i.e. win10 v1607 (14393.321)):
Worked before? If so, with which NuGet version:
Detailed repro steps so we can see the same problem
create a netstandard2.0 class lib, create a NuGet package, publish it (Nexus, NuGet)
add properties to the project
create a console app, reference the class lib
Add the following target to the console app project
Publish the project in Visual Studio/Rider/VsCode, the XML file for the class lib is published
Build the project using Docker.
Examine the image, notice the XML file for the class library is missing
Other suggested things
Verbose Logs
verbose logs added below
Please include verbose logs (NuGet.exe -verbosity detailed | dotnet.exe --verbosity diag | etc...)
Sample Project
project added below
The text was updated successfully, but these errors were encountered: