Skip to main content

Publish .NET Submodules with NuGet

What you’ll learn

How to publish projects from your .NET Core application repository, enabling their utilization in other application components. Example use case could be when you have a project API that you want to use in more than one component.

Steps

  1. Open the repository of your chosen component
  2. In the root of your repository, open/create a file named submoduleToPublish
  3. For each submodule that you want to share with other components, add a line to this file in the following format: submoduleName/submoduleName.csproj
    • these .csproj files have to be packable, in order to make a project packable, set the IsPackable property to true (add the following line to the .csproj file - <IsPackable>true</IsPackable>)
  4. Build your component
  5. After the build, your published submodules can be found here: {your-nuget-repository}/submoduleName.version.nupkg
    • You can find the link to the NuGet repository in the Setup Instructions (Choose Action -> Setup Instructions -> Setup Nuget)