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
- Open the repository of your chosen component
- In the root of your repository, open/create a file named
submoduleToPublish
- 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>
)
- these
- Build your component
- 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)