Skip to content

"dotnet new" templates for building NuGet-published (content-only) multi-targeting libraries with all the bells and whistles

License

Notifications You must be signed in to change notification settings

dennisdoomen/dotnet-package-templates

Repository files navigation


.NET Library Package Templates

"dotnet new" templates for building NuGet-published multi-targeting libraries with all the bells and whistles

About

What's this?

A bunch of dotnet new templates to quickly get you started building high-quality libraries including everything you need to publish it on NuGet or make it available as open-source.

It includes:

  • Multi-targeting to cover as many .NET frameworks as possible
  • Code coverage using Coverlet and Coveralls.io
  • Static code analysis using Roslyn analyzers [StyleCop], [Roslynator], [CSharpGuidelinesAnalyzer] and [Meziantou].
  • Auto-formatting using .editorconfig and settings honored by [JetBrains Rider] and [ReSharper]
  • A [Nuke] C# build script that you can run locally as well as using GitHub Actions (or others)
  • A GitHub Actions workflow that builds, tests, packages and publishes your library
  • An extensive read-me
  • Automatic versioning using [GitVersion] and tagging
  • Contribution guidelines
  • Bug report templates
  • Customized release notes templates for GitHub
  • A test project using [xUnit] and [Fluent Assertions 7]
  • Support for content-only NuGet packages
  • Validation of the public API of the library against snapshots using [Verify]

What's so special about that?

I like to build my software systems in a nicely broken down set of libraries that are easy to maintain, test and deploy based on the Principles Of Successful Package Management. But every time I or the teams I work with need to start a new library or reusable component, we have to scramble so much from other projects, I felt this good fill the gap.

This is the result of years of experience in building in-house and open-source libraries that are used by thousands of developers around the world. I hope it's a great starting point for building your own libraries.

Who created this?

My name is Dennis Doomen and I'm a Microsoft MVP and Principal Consultant at Aviva Solutions with 28 years of experience under my belt. As a software architect and/or lead developer, I specialize in designing full-stack enterprise solutions based on .NET as well as providing coaching on all aspects of designing, building, deploying and maintaining software systems. I'm the author of several open-source projects such as Fluent Assertions, Reflectify, Liquid Projections, and I've been maintaining coding guidelines for C# since 2001.

Contact me through Email, Bluesky, Twitter/X or Mastadon

Download

This library is available as a NuGet package on https://nuget.org. To install it, use the following command-line:

dotnet new -i DotNetPackageTemplates

dotnet new Binary.Package.Template --name YourLibraryName

How do I use it?

todo: what to customize after creating the project todo: silent formatting in Rider and ReSharper

Contributors

Your contributions are always welcome! Please have a look at the contribution guidelines first.

contrib.rocks image

(Made with contrib.rocks)

Versioning

This library uses Semantic Versioning to give meaning to the version numbers. For the versions available, see the tags on this repository.

Credits

This library wouldn't have been possible without the following tools, packages and companies:

Support the project

You may also like

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

About

"dotnet new" templates for building NuGet-published (content-only) multi-targeting libraries with all the bells and whistles

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published