Special Offer: My C#/.NET Bootcamp Course is out now. Get 10% OFF using the code FRIENDS10.

I recently asked YOU, the .NET community, for open-source packages that deserve some love.

I didn’t expect many replies. However, people tweeted so many interesting and helpful libraries that I thought sharing them in a video was a great idea.


Some of the libraries are still unknown. Others are popular and well-known to experienced .NET developers. 

However, all of them deserve some attention.

Intellenum

Intellenum is a package that provides a fast and efficient way to deal with enum types using source code generators.

It allows different ways how to define enums. You can also change the underlying type and use more advanced concepts, such as types implementing the IComparable interface.

Performance seems to be very good. For some operations, it’s even faster than the standard C# enum implementation.

Vogen

Vogen generates Value Objects using C# source generators. 

It seems like Vogen stands for Value Objects Generation, so I call it Vogen even though other pronunciations might be possible.

It helps turn generic int, decimal, and other primitive data types into strongly typed domain types such as CustomerId, and AccountBalance.

One of the key features of Vogen is ensuring the validity of the value objects. It adds code analyzers that help you avoid mistakes by throwing compiler errors.

Fluent Assertions

Fluent Assertions is a well-known package that provides an extensive set of extension methods that allow the specification of an outcome of an automated test.

Its strength is that the readability of the tests is massively improved by using a fluent API style.

Fluent Assertions goes back to the .NET Framework days but can be used for all kinds of .NET-based frameworks, including the latest .NET versions.

LoFuUnit

LoFuUnit allows for unit testing with local functions. Local functions have been introduced in C# 7, and using LoFuUnit we can use them to implement unit tests.

The library supports xUnit, NUnit, and MsTest as test frameworks and offers various mocking solutions.

Even though it’s been available for a few years, it hasn’t been widely adopted. Give it a try, and let me know what you think of this approach in the comments.

GEmojiSharp

GEmojiSharp brings the well-known emoji syntax from GitHub to C#. With this library, you can replace the text representation with the emoji and vice-versa.

There is also support for more advanced scenarios, such as parsing a string and replacing emojis.

It can be used in Razor files using HtmlHelpers, for Blazor web applications, and various other use cases.

ThoughtStuff.Caching

ThoughtStuff.Caching offers a simple way to register a service as a cached service in a .NET application.

For long-running service operations, having a cached version that quickly replies to incoming requests before recalculating the result again is very helpful in reducing the cost of a service.

It is a relatively new package with only a handful of starts on GitHub so far. Let’s change that with this video. Let’s try it out and leave some feedback.

FusionCache

FusionCache is a sophisticated caching library that claims to be easy to use and offers high performance.

Besides an extensive features list, FusionCache also offers a gentle Introduction, as well as a step-by-step guide in their GitHub repository. 

I’m sure it’s helpful information for developers like me who haven’t worked with advanced caching solutions before.

FusionCache’s creator Jody Donetti was also featured on the Microsoft Developer channel on YouTube.

WPF AutoComplete TextBox

WPF AutoComplete TextBox provides, as the name suggests, an auto-complete input field for WPF applications.

It offers an extensive set of dependency properties to customize its behavior and appearance.

It was developed in 2014 and moved from Codeproject to Github in 2016. The project seems to be popular, and if you don’t have access to one of the commercial control libraries, having a working auto-complete field is always a great improvement for your WPF applications.

TerevintoSoftware.StaticSiteGenerator

The Static Site Generator by Terevinto Software allows C# developers to use familiar ASP.NET MVC concepts, such as Views, Partials, Layouts etc., to build a static website.

Static websites have the benefit of fast loading times and low hosting costs. I’m a huge fan of static websites but haven’t found a .NET-based site generator that suits my needs.

This project is relatively new. I encourage you to try it out and leave feedback.

Htmx.Net

Htmx.Net adds server-side helper methods for the HttpRequest and HttpResponse types to make working with HTMX server-side concepts simpler.

If you haven’t heard of HTMX before, I definitely suggest learning about it. 

HTMX is a more modern version of HTML that allows HTML elements to trigger requests and swap parts of the HTML with the responses. It leverages the full power of HTML to build modern web applications without JavaScript web frameworks.

EntityFramework.Exceptions

EntityFramework.Exceptions turns the generic DbUpdateException into strongly typed exceptions such as a UniqueContraintException or a CannotInsertNullException.

It supports SQLServer, PostreSQL, SQLite, Oracle, and MySQL databases.

The library has been featured in an Entity Framework Community Standup on the dotnet YouTube channel.

PeachPie

PeachPie is a PHP compiler that allows PHP code to run on .NET. Additionally, it allows using Visual Studio to develop PHP code.

With the provided Visual Studio extension, you can create a PeachPie project, write PHP code, execute, and debug it running on .NET.

PeachPie is part of the .NET Foundation and aims to provide access to .NET for PHP developers and vice-versa.

NBomber

NBomber is a modern and flexible load-testing framework. It’s designed to test any system regardless of a protocol, such as HTTP, WebSockets, AMQP, etc., and uses a semantic Pull/Push model.

It can be used to test the reliability and performance of any .NET system. It helps prevent regressions and performance problems.

Load testing becomes more and more important when moving more services to the cloud and building distributed systems.

NBomber is actively developed and implemented in F#.

CommandQuery

CommandQuery offers command and query separation for ASP.NET Core, ASP.NET WebAPI, AWS Lambda, Azure Functions, and Google Cloud Functions.

For example, for ASP.NET Core WebAPI, it eliminates boilerplate code by providing base classes for controllers handling query and command operations.

LottieSharp

Lottie is an open-source animation file format, and LottieSharp brings support for Lottie files to WPF applications.

The package includes a LottieAnimationView that can be used in XAML controls to display a Lottie animation within a WPF application.

Lottie animations are stored as JSON files, and LottieSharp renders the animation using SkiaSharp and Skottie.

Configuration.Extensions.EnvironmentFile

This package adds support for Unix-style environment files to configure .NET applications.

According to the GitHub page, it has been built to allow for configuring the locally running app the same as in production.

It supports default behaviors, you can load multiple files, and it handles variable prefixes.

Guard Clauses

A guard clause allows for argument validation and implements the failing fast philosophy.

It checks for invalid inputs and immediately fails if any are found.

Its fluent API allows for null-checking, ensuring a value lies in the range of valid values, validating strings, and many other use cases.

The package is easily extensible. By implementing classes in the same namespace, they show up in the editor’s IntelliSense.

Conclusion

There are so many valuable community-driven packages and libraries for .NET development.

The packages mentioned in this article and the video are based on community feedback received on a tweet. It is neither complete nor in any particular order. 

Also, if your favorite library hasn’t made it, there is always another chance.

If you know another library that deserves more attention and hasn’t made it, write it in the comments, and if there are enough packages, I might create a second part featuring them.

Also, let me know what your favorite library is and if you will try something new that you learned about today.

Subscribe to the YouTube channel to learn more about .NET development.

 

Claudio Bernasconi

I'm an enthusiastic Software Engineer with a passion for teaching .NET development on YouTube, writing articles about my journey on my blog, and making people smile.