How to Solve the HTTP Error 500.31 – Failed to Load ASP.NET Core Runtime Error
In this article, we will learn about the HTTP Error 500.31 generated by IIS, what causes it, and how we can solve it. Let's start. HTTP Error 500.31 Description We've just published our first .NET Core application on the IIS, and we're eager to see how it looks. We...
Code Maze Weekly #181
Issue #181 of the Code Maze weekly. Check out what's new this week and enjoy the read. .NET and C# Top Picks Moq and the Problem with Open Source [www.youtube.com] A good breakdown of Moq's situation for those that haven't heard what's...
Targeting Multiple Frameworks in a .NET Project
In this article, we're going to explain the importance and benefits of targeting multiple frameworks in a single .NET project. Let's start....
Prevent SQL Injection With EF Core, Dapper, and ADO.NET
SQL Injection is a severe security vulnerability that can harm applications that use databases. In this article, we'll learn about SQL Injection attacks, what they can do, and how to protect our applications from them. We'll focus on using popular ORM tools like EF...
How to Generate a Stream From a String?
Generating a stream from a string is a common operation we perform when building applications. In this article, we will discuss two ways we can achieve that in .NET. Interceptors are a new .NET 8 feature worth exploring. Let's check out what interceptors do with Khalid Abuhakmeh....
How to Configure Rolling File Logging With Serilog
Logging holds a crucial role in software development, as it provides software engineers valuable insights into the behavior and health of their applications. Moreover, Serilog, a popular logging framework for .NET applications, offers a wide range of features. One...
ModuleInitializer Attribute in C#
As a C# developer, you might have overlooked the ModuleInitializer attribute introduced in version 9 of the language. This attribute is a hidden gem in the extensive BCL APIs and designates a method that the runtime should first invoke when loading the assembly....
Extending IdentityUser With Custom Properties in ASP.NET Core
In this article, we are going to learn about extending IdentityUser with custom properties in ASP.NET Core Identity. Let's start....
Techniques for Sorting a List in C#
In this article, we will explore different techniques for sorting a list. A common task we face as developers is the need to sort a collection of data. The C# language provides us with a variety of ways in which we can accomplish this task. To help us have a better...
Value vs Reference Types in C# – In Depth Guide
In this article, we will learn about the categories of C# data types. We will deep dive into the differences between value types and reference types, what are they and what's the behavior of each type when instantiated, compared, or assigned. It's important to...
What Is Model Builder and How to Use It in ML.NET
In this article, we will take a look at ML.NET Model Builder for Visual Studio. Following our introductory article on ML.NET, in this one, we will learn what it is and how to use it in our projects. [sc name="github"...
Source Generators in C#
Traditionally, code generation in C# involved using external tools or templates to generate code before the compilation process, like the T4 template. However, with source generators, code generation becomes an integral part of the compilation itself. In this article,...
How to Merge Dictionaries in C#?
In this article, we will explore several ways of how to merge dictionaries in C# and compare their performance to help you choose the best option for your specific use case. [sc name="github"...
Effective Mocking With NSubstitute in .NET
In this article, we will delve into the world of mocking with NSubstitute in .NET and explore how it can help us create comprehensive and efficient tests for our projects. [sc name="github"...
What is Locking and How to Use a Locking Mechanism in C#
In this article, we will discuss the locking mechanism in C#. We will explain what locking is and why we need it. We will demonstrate and explain different ways how we can use the mechanism. [sc name="github"...