Need help structuring a class library for internal tools
Hi there, I'm working on creating an internal tool for exposing some commonly used functionality that requires external binaries.
So we have a business critical core application that consists of many modules. These modules all have their own APIs available through .dll files. Assume
Customers.dll
, Finance.dll
, Products.dll
and so on. Each one of these have IProductService
and IProductConfigurationService
for example.
When we create solutions, tools or integrations we often use some subselection of these modules, but rarely all. Currently we bake this into the solutions by moving the relevant binaries we'll be using into the repository so that it'll be available to the CI / CD pipelines.
But ideally I'd want to have this as a nuget package from our private nuget repo instead. So instead of finding the binaries we need and physically move them into our repo, I'd prefer something like nuget install OurCoreApp.Customers
, nuget install OurCoreApp.Products
and for that to add the required binaries. That means we only have to update binaries in one place (the OurCoreApp
solution that we use as a nuget package).
However I've never really done this before. I assume this means I'll create a class library called OurCoreApp
, but how do I make the different modules available as separate nuget packages?2 Replies
everything you need to knwo is here: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-pack
dotnet pack command - .NET CLI
The dotnet pack command creates NuGet packages for your .NET project.
and you'll want to set up a nuget server on your local network to publish these packages to. your CI/CD system may have one built-in.