C# Dev Kit 11.0 released with .NET 11

Microsoft has released the C# Dev Kit 11.0 alongside the launch of .NET 11. This version of the C# Dev Kit has been redesigned to significantly improve loading times, compilation speed, and memory usage.

Performance improvements through Native AOT

The kit groups six managed processes into a single native executable compiled with Native AOT, which reduces solution loading times up to 180 times and incremental compilation times up to 39 times for large code bases. This change eliminates the need for just-in-time compilation and reduces the overhead of antivirus checks and image loading.

Enhanced language support and diagnostics

This version also adds advanced language support for editing .csproj, .props, and .targets files, as well as a new feature, C# Doctor, which allows diagnosing environment issues, such as missing SDKs or failed package restores. The extension is now available in preview.

C# language overview

C# is a high-level, general-purpose programming language that supports multiple paradigms. It integrates static typing, lexical scoping, and features like imperative, declarative, functional, generic, object-oriented, and component-oriented programming.

C# Dev Kit and Visual Studio Code

The C# Dev Kit is an extension designed to improve the C# development experience in Visual Studio Code. It aims to provide a more complete, productive, and reliable C# experience in the code editor. However, the C# Dev Kit does not replace the existing C# extension, but complements the language service features it provides.

C# development trends and future goals

Developers know how fast computers can be and want to regain that speed in their tools. The waiting times related to language support loading, project compilation, and test execution are times that could be better spent on other tasks. As part of the launch of .NET 11, Microsoft has completely redesigned the C# Dev Kit to bring significant improvements in terms of performance and memory usage.

Faster loading with project caching

Microsoft measured loading times on two real solutions: Orleans (155 projects) and Aspire (407 projects). The new project caches of the C# Dev Kit contribute to this loading acceleration. The kit no longer rebuilds its understanding of each project every time it is opened; thus, language services, tests, and launch targets are available almost immediately.

Loading improvements with a single process

The previous version launched six managed processes, each of which had to go through antivirus checks, load images from the disk, perform JIT compilation, and then connect to each other. The consolidated CSDevKit process is a native executable, precompiled using the Native AOT feature of .NET. It runs immediately, without needing to load a runtime environment or perform a "just-in-time" compilation at startup.

Faster incremental compilations

The C# Dev Kit 11.0 enables significantly faster incremental compilations through fast update checks and the "Build Acceleration" feature. Using the Aspire solution composed of 407 projects and compiling the entire solution each time, the duration of compilations depends on the structure of the solution.

Memory usage improvements

The previous architecture distributed the internal services of the C# Dev Kit among six interconnected processes. This new version groups these processes within a single server, compiled with Native AOT. Memory usage depends more on the size of the source code than on the number of projects.

Editing MSBuild files with enhanced features

The C# Dev Kit 11.0 offers a new editing experience for .csproj, .props, and .targets files. Developers now benefit from auto-completion suggestions, diagnostics, "go to" definitions, quick fixes, and semantic coloring.

Health checks with C# Doctor

The C# Doctor is also a new feature of the C# Dev Kit. When a project fails to load or behaves unexpectedly, the cause is often related to the environment. It groups all these checks in one place and guides users to an appropriate solution.

Future plans for the C# Dev Kit

"The role of the EDI is evolving. As developers adopt new workflows, we continually identify the gaps in our tools. These architectural changes prepare the extension for the years to come," said Microsoft. The C# Dev Kit 11.0 is now available in preview; the fastest way to see the difference is to update it and open one of your own solutions.