---
title: "C# articles — Ivan Kahl"
description: "Articles by Ivan Kahl about C#."
url: https://ivankahl.com/blog/tags/csharp/
---

Blog · Topic

# C#

16 articles tagged C#.

## 2026

12 Mar 2026

### [8 NDepend Rules to Enforce Domain-Driven Design in .NET](https://ivankahl.com/blog/8-ndepend-rules-to-enforce-domain-driven-design-in-dotnet/)

Eight NDepend CQLinq rules automate Domain-Driven Design enforcement in .NET, protecting architectural boundaries, entities, and aggregate roots.

13 min read

## 2025

17 Dec 2025

### [Decompiling the New C# 14 field Keyword](https://ivankahl.com/blog/decompiling-the-new-csharp-14-field-keyword/)

The IL code behind the C# 14 field keyword reveals how it removes property boilerplate, and which caveats matter before refactoring an existing codebase.

11 min read

13 Oct 2025

### [Mastering the C# Dispose Pattern](https://ivankahl.com/blog/csharp-dispose-pattern/)

Reliable resource management in C# depends on IDisposable. Implementing it correctly cleans up unmanaged resources like file handles and connections, and prevents leaks.

9 min read

10 Sept 2025

### [What's New in C# 14: Null-Conditional Assignments](https://ivankahl.com/blog/csharp-14-null-conditional-assignments/)

C# 14 adds null-conditional assignment, a feature that safely assigns values to properties or indexers without long chains of if statements.

4 min read

04 Aug 2025

### [What's New in C# 14: User-Defined Compound Assignments](https://ivankahl.com/blog/csharp-14-user-defined-compound-assignments/)

C# 14 lets types define their own compound assignment operators, avoiding unnecessary object creation. The feature is explained along with the pitfalls to avoid.

4 min read

06 Jan 2025

### [Beyond the Random Class: Cryptographic Randomness in .NET 6+](https://ivankahl.com/blog/beyond-the-random-class-cryptographic-randomness-in-net-6/)

Security-sensitive code needs true randomness. Here, .NET's RandomNumberGenerator class is used to produce cryptographically secure random values instead of Random.

7 min read

01 Jan 2025

### [C# Null-Conditional (?.) & Null-Coalescing (??) Operators Explained](https://ivankahl.com/blog/csharp-null-conditional-and-null-coalescing-operators-explained/)

C#'s null-conditional and null-coalescing operators handle null values gracefully, resulting in cleaner and more robust code. Each is explained with examples.

4 min read

## 2022

21 Mar 2022

### [Extension Methods in C#](https://ivankahl.com/blog/extension-methods-in-csharp/)

Extension methods let C# developers add functionality to existing classes, even sealed third-party ones, without resorting to inheritance or wrapper classes.

5 min read

## 2020

06 Dec 2020

### [Three Methods to Convert Strings into Enums in C#](https://ivankahl.com/blog/three-methods-to-convert-strings-into-enums-in-csharp/)

Three methods for converting strings into enums in C# are compared, with guidance on which approach best suits different performance and safety requirements.

5 min read

22 Oct 2020

### [Using Config.Net for .NET Application Configurations](https://ivankahl.com/blog/use-config-net-for-net-application-configurations/)

Config.Net offers an interface-based way to manage settings in .NET and .NET Core applications with minimal boilerplate. A follow-up to the App.config article.

5 min read

13 Jun 2020

### [The Comprehensive Guide to Custom DateTime String Formats in C#](https://ivankahl.com/blog/the-comprehensive-guide-to-custom-datetime-string-formats-in-csharp/)

C# offers several ways to turn a DateTime into a string. Custom format specifiers give full control over the output, and each one is explained with examples.

8 min read

## 2019

06 Jan 2019

### [Cannot process file because of mark of the web error in Visual C# project](https://ivankahl.com/blog/cannot-process-file-because-of-mark-of-the-web-error-in-visual-c-project/)

A build error caused by the Mark of the Web can block Visual Studio projects. Several fixes are covered, from unblocking files to more obscure solutions.

4 min read

## 2018

08 Aug 2018

### [Enabling CORS in Nancy](https://ivankahl.com/blog/enabling-cors-in-nancy/)

A single line of code in a Nancy module enables CORS, allowing a REST API built with Nancy to be called from JavaScript hosted on other domains.

2 min read

01 Apr 2018

### [Sage CRM .NET Templates Visual Studio Extension](https://ivankahl.com/blog/sage-crm-net-templates-visual-studio-extension/)

A Visual Studio extension speeds up .NET development for Sage CRM, bundling project templates, item templates, and snippets for commonly used components.

4 min read

29 Jan 2018

### [Using Reflection to execute assemblies at runtime in C#](https://ivankahl.com/blog/using-reflection-to-execute-assemblies-at-runtime-in-c/)

Reflection lets a C# application load DLL assemblies at runtime, extract methods from them, and execute those methods without compile-time references.

8 min read

24 Jan 2018

### [Creating Custom Configuration Sections in App.config](https://ivankahl.com/blog/creating-custom-configuration-sections-in-app-config/)

Custom configuration sections let a .NET app read structured settings from its App.config file. The classes needed to define and read them are demonstrated.

6 min read
