dotnet pack multiple projects into one package
Asked Answered
O

1

7

I have a build pipeline that is building multiple library files in a single solution. In the YML file I have the following task to package the dlls;

- task: DotNetCoreCLI@2
  displayName: 'Create nuget packages'
  inputs:
    command: 'pack'
    packagesToPack: 'Framework/**/*.csproj;!**/*.Test.csproj'
    packDirectory: '$(Build.ArtifactStagingDirectory)/packages/nuget'
    nobuild: true
    versioningScheme: 'byBuildNumber'

This creates all my library files as seperate nupkg files. I would like them in one nupkg file.

Is this possible using dotnet pack?

Orthodox answered 7/7, 2021 at 14:41 Comment(0)
C
0

One of the way of doing that is to create a nuspec that includes outputs of the csproj you want to bundle since the pack command only accepts a single project.

You can also use the dependencies attribute to link to other nupkg instead of bundling them.

Cardamom answered 15/2, 2022 at 14:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.