Publishing Projects In .NET Core repository Into NuGet
🕓 15 minutes
What you’ll learn​
How to publish your projects from your .NET Core application repository, so you can use them in another application component. It is useful when you have a project/API that you want to use in more than one component.
Steps​
- Open repository of your .NET Core project on GitLab.
- If you see a file named submoduleToPublish open it, otherwise create a new file with the name submoduleToPublish in the root of repository.
- In this file, write down all of the projects that you want to share between components. Each one on a new line in this format:
SubmoduleName/SubmoduleName.csproj
. For example:Nis.Carrier.Info.Svc.Api/Nis.Carrier.Info.Svc.Api.csproj
- After you build your component containing the file named submoduleToPublish, you will find your published projects in NuGet repository under this structure:
componentName/submoduleName/version/submoduleName.version.nupkg
- If everything goes right, you can now use your published projects as a dependency in your other application components.