Open dotMorten opened 4 years ago
I get exactly the same issue with a target that looks like this (no ProduceOnlyReferenceAssembly), I do this workaround because of another issue with symbols and nuget (https://github.com/dotnet/sdk/issues/1458):
<PropertyGroup>
<IncludeSymbols>false</IncludeSymbols>
<EmbedAllSources>true</EmbedAllSources>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<DebugType>embedded</DebugType>
</PropertyGroup>
@dotMorten thanks for the workaround !
Details about Problem
NuGet product used: VS UI, dotnet.exe
dotnet.exe --version (if appropriate): 3.1.201
VS version (if appropriate): 16.5.4
Detailed repro steps so we can see the same problem
Create a new .NET Standard 2.0 class library project.
Set
ProduceOnlyReferenceAssembly
toTrue
Pack the project (
VS IDE
ordotnet pack
).Observe the error: 1>------ Build started: Project: PackageFailureRepro, Configuration: Debug Any CPU ------ 1>C:\Program Files\dotnet\sdk\3.1.201\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(198,5): error NU5026: The file 'C:\Users\mn\source\repos\PackageFailureRepro\PackageFailureRepro\bin\Debug\netstandard2.0\PackageFailureRepro.pdb' to be packed was not found on disk. 1>Done building project "PackageFailureRepro.csproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Ref assemblies doesn't generate PDBs, but even weirder is I'm not even trying to pack PDBs in the package.
Full project:
Sample Project
PackageFailureRepro.zip
Workaround