0

I'm using Nuke build and want to create nuget packages targeting multiple frameworks. Because I sign the assemblies, I use separate tasks

  1. Compile
  2. Test
  3. Sign
  4. Pack

This is the command that nuke generates:

"C:\Program Files\dotnet\dotnet.exe" pack C:\Users\username\source\repos\Company.common\Company.Common\Company.Common.csproj --include-source --include-symbols --no-build --no-restore --output C:\Users\username\source\repos\Company.common\_artifacts\nuget --no-dependencies /property:Version=1.8.0-ico-49-make-com-0001 /property:OutputPath=C:\Users\username\source\repos\Company.common\_build\debug\Company.Common /property:SymbolPackageFormat=snupkg

This is the folder structure that is generated by my compile task:

_build
   |-debug
       |-Company.Common
              |-net6.0
                   |-Company.Common.dll
              |-netstandard2.0
                   |-Company.Common.dll

I get this exception:

[ERR] Pack: C:\Program Files\dotnet\sdk\7.0.203\Sdks\NuGet.Build.Tasks.Pack\buildCrossTargeting\NuGet.Build.Tasks.Pack.targets(221,5): error NU5026: The file 'C:\Users\username\source\repos\Company.common\_build\debug\Company.Common\Company.Common.dll' to be packed was not found on disk. [C:\Users\username\source\repos\Company.common\Company.Common\Company.Common.csproj]

I don't want to point it to the individual runtimes as the nuget package then only contains this specific runtime.

How can I use the output from the previous steps using DotNetPack command?

Ksdmg
  • 397
  • 5
  • 15

0 Answers0