C# Nuget packages - Design/Architecture patterns and best practices
Hi,
I'm looking to start writing an open source nuget package that implements and a specific company's API, but not really finding much information on best practices for patterns and structure of the project.
I understand points like versioning, authoring, etc.
Are there any specific requirements or limitations I need to take into account code wise however? Are there any specific design patterns that simplifies package development and/or implementation?
2 Replies
If you're gonna be doing any asynchronous operations inside — and it seems you will — see if you should use
.ConfigureAwait(false)
Far as general tips go, build the nugets in a CI/CD pipeline and upload to Nuget from thereThey do exist, in term of how you implement log messages, for instance implementing an
ILogger
to forward log messages.
Nuget packages are just libraries/dlls, so your structure isn't any different from any other library.
A *.nupkg
(Nuget package) is just a container file, like an archive (zip/rar/7z) with specific information in addition to the dlls.