1

I have Visual Studio solution with 10 .net core 3.1 library projects (let's call them CORE). One of them is a main project. It has references to other projects.

I want to have one nuget package (stored in azure feed) which I can use in my other solutions because I won't add all dlls every time when I need CORE functionality. I need to define Azure Pipeline to do that job. How to define that pipeline which produce one package containing all other references (dlls)?

ElConrado
  • 1,477
  • 4
  • 20
  • 46

1 Answers1

3

When you build the NuGet package, you can provide -IncludeReferencedProjects switch to the nuget pack command, and the referenced projects will be added as part of the package:

nuget pack MyProject.csproj -IncludeReferencedProjects

Note, that according to the docs:

If a referenced project includes a .nuspec file of its own, then NuGet adds that referenced project as a dependency instead. You need to package and publish that project separately.

I would suggest you get acquainted with this article. There are more options to granularly control the contents of your package. The raw nuget commands that are referenced there map easily to the appropriate CI tasks.

Yan Sklyarenko
  • 31,557
  • 24
  • 104
  • 139