Several new developers take their first step into ASP.Net Core on a daily basis for their web development career. Choosing and Mastering the best libraries that help optimize the development experience is the make-or-break factor for any technology. With the rapid growth of .NET Core in the past few years, there are several libraries that came up to cater to various needs of developers. It is quite vital for companies/project managers/developers to pick the most efficient and essential libraries for asp.net core.
To help you decide and explore the various tools that are considered important for ASP.NET Core, I have compiled a list of 15 Essential Libraries For ASP.Net Core Developers. Here is how the list goes.
PS, these libraries are completely FREE to use.
Serilog / NLog
Ensuring a well-defined Logging mechanism is the first priority when it comes to software development. You really don’t want to get in the game of ” Guess where the bug is? “, do you? For .NET Core, the most popular packages for structured logging is NLog / Serilog. Both of these loggers have quite a good community and well-defined documentation around them. Logging may not seem trivial, but trust me, once your asp.net core application has gone into a production environment, these Loggers are going to be your best friends.
Serilog and Nlog allow you to log to the console, file system, database, and even can mail you when a fatal error has occurred in your application. Pretty cool right?
I have written an extensive guide on ‘Integrating Serilog in ASP.NET Core 3.1 Applications‘. The article will teach you to implement Serilog with ease. Do check it out!
Hangfire / Quartz
Does your application potentially have any long-running task, jobs that are to be scheduled for a particular time in a day or even better, recurring jobs? Hangfire and Quartz both allow you to achieve all these hassle-free right out of the box with minimal configurations. All the jobs are processed in the background in a different thread.
I prefer Hangfire over Quartz for one reason, The Hangfire dashboard. Just add one line of code to your startup class and you already have a Job Dashboard hooked up to your application. It’s that easy with Hangfire.That being said , Quartz too comes in par with Hangfire in several other ways.
I have a in-depth article that explains various concepts of Hangfire and how to implement it in ASP.NET Core Applications. Follow this link to read the article.
Here is one of the most commonly used Open Sourced Message-Broker with a plug and play architecture. It leverages the Asynchronous concept of development. Essentially it acts as a middleman that can be used to reduce loads and response times taken by web servers. It supports various messaging protocols.
Learn more about RabbitMQ here.
Dapper / Entity Framework Core
In the .NET world, Dapper and Entity Framework Core are few of the primary Object Relational Mappers. Dapper has a very thin layer between the application and your database, hence it much faster than EF Core. On the other hand, Entity Framework is feature-packed ORM, unlike Dapper. 9 out of 10 times, the performance difference between Dapper and EF Core goes un-noticed. These ORMs essentially provide a layer between your application and database, so that you can play around with the data much easier rather than having to use the traditional SQL queries within your application.
I have recently posted an in-depth article on Entity Framework Core – Code First Approach. Do check it out.
This is quite an essential middleware offered by Microsoft for monitoring the health of the applcation and other related components. Health checks are exposed are endpoints that can be configured for vaiety of purposes such as database health monitoring, external api health, server resources and much more.
Read more about Health Checks here.
Read more about SignalR here.
You must have been living under a rock if you haven’t ever heard of this guy! This most downloaded package is a JSON framework for .NET that has been around for quite a long time now. It allows you to convert an object to and from JSON.
Learn more about NewtonSoft here.
Testing is quite vital before your application becomes production ready. NUnit is an open sourced testing framework used to write test cases and assertions. It also shows up a well structured report after running the tests.
Learn more about NUnit here.
One of my favorite libraries for ASP.NET Core Applications, especially while implementing Onion Architecture. This package allows you to implement Mediator Pattern in your application, so as to separate the read and write operations, enabling you to write a more decoupled application. I have written a detailed article on Implementing MediatR in an ASP.NET Core Application.
Tired of defining validation rules in your entity classes? Imagine having to put all the Required, Min length Data Annotation Attributes over each property. This is actually not a good way to write clean code. FluentValidation is a .NET Validation Library that allows you to build strongly-typed validation rules. It is quite handy when you want to create complex validations rules for class properties.
Here is a complete Setup Guide for your ASP.NET Core Applications . Read the article here.
Read more about FluentValidations here.
Here is a library that profiles your application in realtime. It provides a UI and helps you measure the performance of your application. It helps you identify the performance issues in your ASP.NET Core Application.
PRO TIP – There is a Entity Framework extension for Mini Profiler, which helps you measure your query performance. Knew about this before?
Learn more about MiniProfiler here.
Let’s say you have 2 different objects with multiple properties. These properties may have different names in a different object. So how do you transfer data from one to another? Yes, there is a traditional way of iterating through each property and assigning it to the target property. But what happens when you start having huge classes with 20+ properties. It is not smart to write more and more lines to map these properties.
This is where AutoMapper comes. Automapper is a library that takes out all of the fuss of mapping one object to another. It has built-in conventions and logic on how to map an object to another which you could override as well. It is one of the most powerful libraries on this list.
This is quite interesting. Having your own library to help you with basic stuff is actually very cool. Imagine a function/helper to convert a list of objects to a Datatable. And this function is repeated in multiple projects. Wouldn’t it be a better and cooler if you had your own library that contains this particular function? You will just need to add a reference to it in your new projects and start using them. Building components / Libraries that allow you to code effectively, saves you quite a lot of time. This Library would also grow with time. I will write a small article about this, as it is interesting to start thinking about it. Stay tuned.
What’s your List of Essential Libraries For ASP.Net Core?
Feel free to contribute to this list, so that we can make this a near to perfect one that can help out other fellow .net core developers.