NDepend Blog

Improve your .NET code quality with NDepend

Will Visual Studio Be Migrated to .NET Core and Become Multi-Platform?

April 22, 2024 7 minutes read I came across comments on a recent Reddit post and thought it would be intriguing to analyze the DLLs of Visual Studio 2022 (version...
NDepend April 22, 2024

C# String Interpolation Explained

April 17, 2024 4 minutes read C# String Interpolation is a powerful feature that simplifies the syntax for embedding variables and expressions within strings to construct strings dynamically. String interpolation...
NDepend April 17, 2024

Clean Architecture in ASP.NET Core

April 16, 2024 9 minutes read The Clean Architecture pattern has gained significant popularity for the design and development of software applications. It emphasizes key principles to better maintain, scale,...
NDepend April 16, 2024

Class vs Struct in C#: Making Informed Choices

April 15, 2024 9 minutes read In C# programming, choosing the right data type between classes and structs is a crucial decision that impacts application performance and design. This article presents...
NDepend April 15, 2024

C# Pattern Matching Explained

April 11, 2024 7 minutes read   Since the C# version 7, C# has support for pattern matching. C# pattern matching is here to simplify complex if-else statements into more...
NDepend April 11, 2024

Architecture of a .NET Application: 8 Case Studies

January 30, 2024 9 minutes read This recent question on Reddit’s Number of projects per solution led to interesting debates. Of course, the answer depends largely on the overall size...
NDepend January 30, 2024

C# Record Explained

January 23, 2024 7 minutes read A C# record is a data-centric type that usually doesn’t contain behaviors.  C# 9 introduced the keyword record to quickly declare a class primarily...
NDepend January 23, 2024

C# ValueTuple Full Guide

January 18, 2024 9 minutes read In 2017 C# 7.0 introduced ValueTuple. This feature makes it convenient to handle lightweight data structures. Here is an example of relying on the...
NDepend January 18, 2024

Improve Visual Studio Build Performance

August 11, 2023 7 minutes read Time is your most precious asset and slow build is high in the list of developer’s productivity killers. With slow build the penalty is...
NDepend August 11, 2023

Improved .NET Debugging Experience with Source Link

June 20, 2023 3 minutes read Source Link is a Microsoft technology that lets .NET developers debug the source code of NuGet packages referenced by their applications. I underlined source...
NDepend June 20, 2023

.NET Micro-Optimization and Refactoring Trick

May 31, 2023 3 minutes read Recently, I made an interesting observation regarding Dictionary<string,T>: the method TryGetValue() is faster when building  with new Dictionary<string,T>(StringComparer.Ordinal). This performance difference can be attributed...
NDepend May 31, 2023

C#12 class and struct Primary Constructors

April 13, 2023 3 minutes read Since C#9 we have the convenient primary constructor syntax for class record (or just record) and struct record: [crayon-67e1eded7f4c7550305239/] C#12 introduces primary constructor for...
NDepend April 13, 2023

C# 11 required members

November 15, 2022 3 minutes read C# 11 proposes the new keyword required that can apply to an instance property or an instance field declaration within a class, a record...
NDepend November 15, 2022

C# 11 File Scoped Types

October 27, 2022 4 minutes read C#11 added the file scoped types feature: a new file modifier that can be applied to any type definition to restrict its usage to...
NDepend October 27, 2022

Managed pointers, Span, ref struct, C#11 ref fields and the scoped keyword

October 25, 2022 9 minutes read The concept of managed pointer exists in the NET runtime and C# since the inception of the platform in the early 2000. Managed pointers...
NDepend October 25, 2022

WPF / Winforms UI Refactoring: A Case Study

May 11, 2022 4 minutes read WPF and Winforms are still so massively used that Microsoft fully supports those technologies in .NET Core, .NET 5, 6 , 7 and so...
NDepend May 11, 2022

How to collect return values from Parallel.ForEach?

January 26, 2022 1 minutes read Today I took 10 minutes to answer the 9 years old stackoverflow’s question: How do I collect return values from Parallel.ForEach? I though the...
NDepend January 26, 2022

C# Binary Search: Fast find of a free slot between 0 and uint.MaxValue

January 3, 2022 2 minutes read When a user is exporting a result to a document with NDepend, the tool needs to find a file name not taken in the...
NDepend January 3, 2022

Solution to Visual Studio 2022 messing up Visual Studio 2019

November 10, 2021 3 minutes read As all .NET developers I am quite excited by Visual Studio 2022 and .NET 6 going RTM. However I noticed that Visual Studio 2022...
NDepend November 10, 2021

5x Lessons Learned from Migrating a Large Legacy to .NET 5/6

October 26, 2021 9 minutes read In January 2020 I wrote the post Not planning now to migrate your .NET 4.8 legacy, is certainly a mistake. Hopefully we followed our...
NDepend October 26, 2021

Debugging a .NET App on Linux from Windows Visual Studio with WSL

September 15, 2021 6 minutes read NDepend analysis, reporting, API and Power-Tools will run on Linux and MacOS with the next version 2021.2. To achieve that, a major refactoring session...
NDepend September 15, 2021

Code Testability: A Case Study

September 1, 2021 2 minutes read [crayon-67e1eded81b73827182838/] This method is untestable because its logic depends on NdpOperatingSystem.Kind which returns an OSPlatform object. Notice the usage of the attribute UncoverableByTest that...
NDepend September 1, 2021

3 productivity Resharper features missing in Visual Studio

August 10, 2021 5 minutes read Resharper is a great Visual Studio productivity extension but on the other hand it slows down significantly the IDE, especially when working with large...
NDepend August 10, 2021

Top 10 New .NET 6.0 API

July 7, 2021 5 minutes read .NET 6 introduces new handy APIs that will make our development journey easier. Let’s go through the top 10 new API in terms of...
NDepend July 7, 2021

How to Logically Name Embedded Resources in .csproj?

June 16, 2021 1 minutes read You can work with .NET for two decades and still discover some useful stuff.  One thing that bothered me till now is that an...
NDepend June 16, 2021

Migrating Delegate.BeginInvoke Calls to .NET Core, .NET 5 and .NET 6

May 26, 2021 3 minutes read In this 2019 post, the .NET Base Class Library engineers announced that the good old Delegate.BeginInvoke .NET Framework syntax wasn’t supported in .NET Core...
NDepend May 26, 2021

On replacing Thread.Abort() in .NET Core

May 19, 2021 3 minutes read Thread.Abort() is not supported in .NET 5 / .NET Core We are actually migrating the NDepend analysis and reporting to .NET 5 and figured...
NDepend May 19, 2021

Visual Studio 2022 64 bits: Elements of history

May 11, 2021 7 minutes read Finally after all these years of waiting Visual Studio 2022 will run in a 64 bits process on 64 bits machines! As a consequence...
NDepend May 11, 2021

Hungarian Notation for Fields in C#

April 21, 2021 6 minutes read If there is one topic that divides the C# developers community, it is the Hungarian notation for fields. In our team we rely on...
NDepend April 21, 2021