History of C#: versions, .NET, Unity, Blazor, and MAUI

C# is a popular programming language leveraged to develop apps, web services, and games. Let's take a peek at the tangled history of its evolution from version to version and explore the different tools that power modern C# development. 1999: the COOL language The story originates with the .NET Framework. Its class libraries were initially created using a managed code compiler system, Simple Managed C. In 1999, Andres Hejlsberg burst into history by gathering a team to create a new language called COOL (C-Like Object Oriented Language). They originally planned to keep this name, but trademark issues forced them to choose a new one. Finally, in 2000, at the Professional Developers Conference, the .NET project was officially announced, and the language was renamed to C#. Its name could be interpreted in several ways. First, C# could inherit a part of its name from its older sibling, the C++ language—adding two more pluses formed a hashtag symbol. Second, it was a reference on musical C-sharp. By the way, there was a funny slide about this interpretation of the name in a talk by Andrey Akinshin from JetBrains at the DotNext conference. Andres Hejlsberg took a part in the development of Turbo Pascal and Embarcadero Delphi, so it wasn't a surprise that C# was also inspired by these languages. Additionally, C# developers drew some ideas from C++, Java, and Smalltalk. For C#, the developers set the following list of design goals: It is intended to be simple, modern, general purpose, and object-oriented programming language. It should include strong type checking, array bound checking, detection of attempts to use uninitialized variables, source code portability and automatic garbage collection. It is intended for use in developing software components than can take advantage of distributed environments. As software portability is very much important, especially for those programmers already familiar with C & C++, C# is best suitable. Provide support for internationalization, as it was very important. It is intended to be suitable for writing applications for both hosted and embedded systems. Let's get it started! 2002: C# 1.0 The first version came out in January 2002, along with Visual Studio .NET 2002. It looked quite like Java with some extra features. For example, C# received properties that looked a lot like object fields but actually invoked class methods when accessed. The language also introduced indexers, which were similar to properties but accepted an array index as a parameter, and events. C# acquired foreach loops, built-in properties for interacting with unmanaged code (DLL and COM), and more. Some C# features were borrowed from C++, like unsigned types, operator overloading, methods with a variable number of parameters, and the goto operator. C# also retained support for pointers but in a limited form: developers could use them only in code marked with unsafe and when the compiler was explicitly configured to allow them. Besides the above features, the first version of C# also included: classes structures interfaces delegates operators and expressions attributes. In April 2003, C# 1.1 was released as part of Visual Studio .NET 2003, and was shortly followed by C# 1.2. These updates introduced minor language modifications. For example, starting with C# 1.2, any code generated within the foreach loop would call IDispose on IEnumerator if that IEnumerator implemented IDisposable. Same year: .NET Framework In 2002, Microsoft came up with a software platform called .NET Framework. At one of the press conferences, Steven Ballmer emphasized that Microsoft, despite the capabilities of home PCs, saw the importance of delivering next-gen services across a variety of devices, not just desktop computers. Due to the limited battery power of mobile devices, apps had to be stored and transmitted via servers, which was different from the practice of storing data locally on desktop PCs. Microsoft had a bunch of reasons for adopting a new strategy. The company was already a market leader in operating systems and browsers, and had experience in developing web and subscription-based software. Microsoft also faced a range of incompatible techs and development environments, so one of the goals of the new platform was the unification and integration of its best tools. They planned to develop a newer version of OS and an IDE for web applications. The basis for the new strategy was the development of Windows DNA 2000, which combined an updated SQL Server database management system and tools for creating web applications. The platform introduced a set of technologies for building and running software applications in various programming languages. Its main component was the Common Language Runtime (CLR), a runtime environment for executing the Common Intermediate Language (CIL) bytecode. The CLR compiled programs written in .NET-compatible languages and provided memory

Apr 29, 2025 - 10:20
 0
History of C#: versions, .NET, Unity, Blazor, and MAUI

C# is a popular programming language leveraged to develop apps, web services, and games. Let's take a peek at the tangled history of its evolution from version to version and explore the different tools that power modern C# development.

1248_csharp/image1.png

1999: the COOL language

The story originates with the .NET Framework. Its class libraries were initially created using a managed code compiler system, Simple Managed C. In 1999, Andres Hejlsberg burst into history by gathering a team to create a new language called COOL (C-Like Object Oriented Language). They originally planned to keep this name, but trademark issues forced them to choose a new one.

Finally, in 2000, at the Professional Developers Conference, the .NET project was officially announced, and the language was renamed to C#.

Its name could be interpreted in several ways. First, C# could inherit a part of its name from its older sibling, the C++ language—adding two more pluses formed a hashtag symbol. Second, it was a reference on musical C-sharp. By the way, there was a funny slide about this interpretation of the name in a talk by Andrey Akinshin from JetBrains at the DotNext conference.

1248_csharp/image2.png

Andres Hejlsberg took a part in the development of Turbo Pascal and Embarcadero Delphi, so it wasn't a surprise that C# was also inspired by these languages. Additionally, C# developers drew some ideas from C++, Java, and Smalltalk. For C#, the developers set the following list of design goals:

  • It is intended to be simple, modern, general purpose, and object-oriented programming language.
  • It should include strong type checking, array bound checking, detection of attempts to use uninitialized variables, source code portability and automatic garbage collection.
  • It is intended for use in developing software components than can take advantage of distributed environments.
  • As software portability is very much important, especially for those programmers already familiar with C & C++, C# is best suitable.
  • Provide support for internationalization, as it was very important.
  • It is intended to be suitable for writing applications for both hosted and embedded systems.

Let's get it started! 2002: C# 1.0

The first version came out in January 2002, along with Visual Studio .NET 2002. It looked quite like Java with some extra features.

For example, C# received properties that looked a lot like object fields but actually invoked class methods when accessed. The language also introduced indexers, which were similar to properties but accepted an array index as a parameter, and events. C# acquired foreach loops, built-in properties for interacting with unmanaged code (DLL and COM), and more.

Some C# features were borrowed from C++, like unsigned types, operator overloading, methods with a variable number of parameters, and the goto operator. C# also retained support for pointers but in a limited form: developers could use them only in code marked with unsafe and when the compiler was explicitly configured to allow them.

Besides the above features, the first version of C# also included:

  • classes
  • structures
  • interfaces
  • delegates
  • operators and expressions
  • attributes.

In April 2003, C# 1.1 was released as part of Visual Studio .NET 2003, and was shortly followed by C# 1.2. These updates introduced minor language modifications. For example, starting with C# 1.2, any code generated within the foreach loop would call IDispose on IEnumerator if that IEnumerator implemented IDisposable.

Same year: .NET Framework

In 2002, Microsoft came up with a software platform called .NET Framework.

At one of the press conferences, Steven Ballmer emphasized that Microsoft, despite the capabilities of home PCs, saw the importance of delivering next-gen services across a variety of devices, not just desktop computers. Due to the limited battery power of mobile devices, apps had to be stored and transmitted via servers, which was different from the practice of storing data locally on desktop PCs.

Microsoft had a bunch of reasons for adopting a new strategy. The company was already a market leader in operating systems and browsers, and had experience in developing web and subscription-based software. Microsoft also faced a range of incompatible techs and development environments, so one of the goals of the new platform was the unification and integration of its best tools.

They planned to develop a newer version of OS and an IDE for web applications. The basis for the new strategy was the development of Windows DNA 2000, which combined an updated SQL Server database management system and tools for creating web applications.

The platform introduced a set of technologies for building and running software applications in various programming languages.

Its main component was the Common Language Runtime (CLR), a runtime environment for executing the Common Intermediate Language (CIL) bytecode. The CLR compiled programs written in .NET-compatible languages and provided memory management, security, exception handling, and multitasking.

One of the key features of the CLR was its support for multiple .NET-compatible programming languages. The CLR provided functionality that was accessible across all languages within this system, allowing developers to write code in one language and seamlessly integrate it with others. This flexibility greatly enhanced the development of applications.

2005: C# 2.0

On November 7, 2005, C# version 2.0 was released along with Visual Studio 2005, bringing many new features and refinements.

One of the major enhancements was generics, which, unlike C++ patterns, got additional features and worked at the level of the virtual machine.

C# also got partial types, allowing a class definition to be split across multiple files. This feature proved valuable for refactoring, and let source generators add additional functionality to any class. These types were marked with the partial keyword.

Besides this, other key features introduced in C# 2.0 included:

  • anonymous methods created via delegate that provide the closure;
  • nullable types;
  • iterators and the yield return operator;
  • the null-coalescing operator ??.

Some of the changes expanded the existing capabilities:

  • separate access modifiers for get and set accessors;
  • method group conversions (delegates);
  • static classes;
  • delegate inference.

Same year: Unity debut

Unity is a powerful cross-platform environment for developing computer games and applications. Developed by Unity Technologies, it uses C# as its primary programming language. The first version of Unity was announced in 2005 at the Worldwide Developers Conference and released later that year. In December 2009, Game Developer named Unity as one of the most influential players in the game development industry.

Originally, Unity was available exclusively for macOS, support for other platforms followed soon after.

Today, Unity allows creating apps that can run on more than 25 different platforms, PCs (Windows, macOS, and Linux), game consoles (PlayStation, Xbox, and Nintendo), mobile devices (iOS and Android), web apps, VR, and AR. A key strength of Unity is that the same project can be deployed across all these platforms with minimal adjustments. Each component tackles a specific task, which makes debugging and scaling more efficient and improves teamwork and performance.

So why is Unity popular? This environment is available to indie developers, but there have been some bumps in the road. For example, in 2023, there was a controversy over licensing changes. Developers that use Unity were obliged to pay for each program installation after hitting a certain number of installations. These changes caused major backlash in the dev community. As a result, Unity rolled back the fee for games earning less than $1 million in revenue, raised the threshold from $100,000 to $200,000, and got rid of the mandatory requirement to show the "Made with Unity" splash screen.

2006: Windows Presentation Foundation

Windows Presentation Foundation—or WPF—is a free, open-source UI framework for building Windows desktop applications. WPF was originally developed by Microsoft and was first released as part of the .NET Framework 3.0 in 2006.

WPF used XAML (an XML-based language) to describe and link UI elements, and C# to define the program's logic. In WPF, UI markup was separated from application logic, which made code more readable and easier to maintain. Unlike WinForms, WPF let the layout designers and developers work separately. WPF-driven apps were standalone desktop programs that could be run directly on the user's computer.

WPF leveraged runtime libraries that were included in all versions of Windows, starting with Windows Vista and Windows Server 2008. As a result, applications built with WPF didn't need any additional components to run because they were already baked into the operating system.

At Microsoft Connect in December 2018, Microsoft announced that WPF became an open-source solution and be hosted on GitHub. Since then, WPF has been available under the MIT license to all developers, making it more accessible and customizable. Even so, WPF remains focused on Windows development and isn't cross-platform.

The WPF design and the XAML language inspired several other UI frameworks, like Avalonia and Uno.

2007: C# 3.0

A new version of C# was released in November 2007 along with Visual Studio 2008. However, the most significant features of the language came with .NET Framework 3.5.

This version introduced the automatically implemented properties, which made property declarations more concise if no complex logic was required in property accessors.

Also, developers got implicit typing with the var keyword, along with anonymous types. These types allowed read-only properties to be encapsulated in a single object without an explicit type declaration. The compiler handled that behind the scenes, but the type is not accessible in the source code.

Query expressions were also introduced, bringing the SQL-like syntax to collection operations using the new keywords, select, from, and where. This functionality was implemented via the new LINQ component.

C# also acquired lambda expressions to create anonymous methods and data structures that could be traversed at runtime. This allowed implicitly typed C# expressions to be translated into other domains like SQL expressions.

Extension methods made it possible to add new functionality to existing types without creating a derived class, recompiling, or alter the original type.

Finally, this version added support for object initializers, which let developers assign values to all available fields and properties at the time of object creation, without requiring a constructor call.

2010-2012: C# 4.0 and C# 5.0

The preview of C# 4.0 was released back in 2008 along with the Visual Studio 2010 preview, but the official version didn't arrive until April 2010.

This update brought dynamic types to the language, which made it possible to create COM interop assemblies during application deployment. For this purpose, the dynamic keyword was added—it indicated that variables and member references bypassed compile-time type checking.

Microsoft also added named and optional parameters. Named arguments let developers specify which parameter to target by name instead of relying on its position in the argument list. Optional parameters made it possible to skip arguments for some method parameters.

With the .NET Framework update came code contracts to define how different entities should interact with each other in the code. These rules clarified program behavior, which streamlined testing, debugging, and maintenance.

The update continued to delight users: there appeared the Task Parallel Library (TPL), the task concept, and classes like Task, TaskFactory, and Parallel.

The System.Collections.Concurrent namespace appeared as well, offering new concurrent collection classes like ConcurrentQueue. These collections not only improved performance, but also more complete thread safety.

The C# 5.0 release in 2012 brought a wave of exciting new features focused on enhancing asynchronous programming:

  • new keywords: async and await;
  • new caller info attributes that streamlined accessing context information, without resorting to verbose reflection code.

2015: C# 6.0

The next update to the language came out with Visual Studio 2015.

This version brought numerous enhancements to boost productivity in C# programming. For example, C# introduced null-conditional operators (?. and ?[ ]). Additionally, C# developers could import static type methods to access static type members without the full type name.

The try-catch mechanism got an upgrade: developers could now set conditions for executing a catch block via the when keyword. Also, await became available in both catch and finally blocks.

Automatically implemented properties were also improved, so they can be initialized when declared. Moreover, it became possible to declare get without the set accessor.

Microsoft further introduced expression-bodied members, enabling methods to be defined using the lambda syntax.

String interpolation was introduced as well, enabling inline expressions by placing a $ at the beginning. This made code more concise than using String.format.

A new nameof operator let developers obtain a short type name as a string.

It became possible to initialize dictionaries using index initializers, just as objects and collections.

Starting with this C# version, the Roslyn compiler was released as a service. The C# compiler itself was now written in C#, and developers could use it in their programs.

Same year: PVS-Studio and analysis of C# projects

On December 22, 2015, PVS-Studio 6.00 came out, introducing a static code analyzer for C#. Upon release, the tool already supported over 40 diagnostic rules.

By June 2016, there were over 100 diagnostic rules. For comparison, PVS-Studio C++ analyzer took 19 months to reach the same number of rules, while the C# team managed it in 10—thanks to the larger team and the Roslyn Code Analysis Framework.

In 2021, PVS-Studio C# analyzer added taint analysis mechanisms, which allowed developers to detect security defects related to external data processing, such as SQL injections, XXS, XXE, and others. A new mechanism for Software Composition Analysis (SCA) also appeared, making it possible to search for vulnerabilities in third-party components.

In 2023, a new set of diagnostic rules was introduced to optimize the source code of Unity engine projects.

Note. You can learn more about PVS-Studio and try the tool in your projects.

2017: C# 7.0

The latest version of C# came out in March 2017, along with the release of Visual Studio 2017. It provided a few changes that built directly on the features from the last version.

The release introduced out variables, which allowed variables to be declared immediately in the method call. The outside block became their scope.

C# also gained the ValueTuple type, along with the deconstruction syntax for unpacking tuple values.

The language also introduced a pattern concept, which was a syntactic construct used to verify a value's shape and extract information from it.

The is keyword was extended to work with types and templates.

The switch-case constructs also evolved: they could now operate with any type, not only primitive ones. In case clauses, developers could use templates and add additional conditions with the when keyword—previously introduced for catch blocks).

Local functions became available, letting developers define methods inside other methods for use only within that scope.

The functionality of the ref keyword was extended. So-called reference variables (variables that refer to other variables) appeared, and it became possible to return references to variables using a ref return.

Microsoft introduced throw expressions that allowed exceptions to be thrown within expression-bodied members.

There were also some changes to literals: binary literals appeared, and the separator symbol _ appeared in numeric literals.

C# 7.1 followed in August 2017, with versions 7.2 and 7.3 released in November 2017 and May 2018, respectively. These updates also added new features of various scales: for example, it became possible to make the Main method asynchronous if it returned the Task object. Default literal expressions were introduced, allowing developers to write a default value, representing the default value of the inferred type at runtime.

Changes boosted performance and enhanced the existing language features.

2018: Blazor

At the 2017 NDC Oslo conference, Microsoft engineer Steve Sanderson introduced Blazor—an experimental framework for developing client-side web applications on the .NET platform. He demonstrated how developers could use C# and Razor syntax to create interactive components, which were then compiled into .NET assemblies and executed in the browser via WebAssembly, using the open-source .NET runtime DotNetAnywhere. The name "Blazor" was a combination of "Browser" and "Razor".

Blazor became an open-source project, and in 2018, Blazor Server was released as part of .NET Core 3.1, allowing for server-side updates to the client browser via WebSockets. Then, Blazor WebAssembly came along, it used the Mono .NET Runtime to work with WebAssembly.

In 2023, with the release of .NET 8, server-side Blazor got some major upgrades that enabled it to be used to create server-side rendering (SSR), becoming an alternative to MVC Razor Pages. Now, developers could select whether components would be interactive and where they would run—on the server or in the browser via WebAssembly. These rendering options are now known as Interactive Render Modes.

2019: C# 8.0

In September 2018, C# 8.0 was released, primarily targeting .NET Core. Some features relied on enhancements to the CLR, while others used library types available only in .NET Core.

This version introduced the readonly modifier to declare that an instance member won't change the state of a struct.

Interfaces could now define default implementations for members.

Pattern matching was also significantly enhanced:

  • Recursive patterns allowed developers to apply one pattern expression to the result of another.
  • The switch expressions became more concise, reducing the need for repetitive case, break, and curly brackets.
  • Property patterns and tuple patterns expanded the pattern-matching toolkit further.

The using declaration was added to ensure that the correct use of the IDisposable instance.

C# continued to evolve its asynchronous capabilities with async/await. The language introduced the IAsyncEnumerable interface and the await foreach statement. Additionally, the System.IasyncDisposable interface brought support for asynchronous resource disposal.

Indices and ranges got a boost with the addition of the ^ and .. operators, along with System.Index and System.Range.

A new null-coalescing assignment operator, ??=, enhanced a common pattern—assigning the right-hand operand to the left-hand operand if the left-hand operand was equal to null.

Unmanaged constructed types appeared. A constructed value type would be considered unmanaged if all its fields were of exclusively unmanaged types—for example, a generic type like .

2020: C# 9

In November 2020, C# 9 was released along with .NET 5, celebrating an exciting milestone in the language's evolution. This version became the default for all assemblies with .NET 5.

Microsoft introduced a new reference type—record, which was immutable by default. Unlike other reference types, records were considered equal if the types and values of their properties and fields were equal. Also, records could only inherit from other records, not from classes—and classes couldn't inherit from records. For record instances, developers could create copies with modified values of specified properties and fields using the with expression.

C# 9 also introduced the init keyword to define an accessor method in a property or indexer—it made possible setting initial values during object initialization.

Starting with this version, top-level statements allowed developers to create programs without the usual boilerplate of namespaces, class, and method declarations. The compiler now independently generated the Program class with an entry point method. However, a single application could have only one file with top-level statements.

This version further improved the pattern-matching mechanism, adding:

  • Type patterns: matched an object of a specified type.
  • Logical patterns: required the input data to match logical operations (and, or, not).
  • Relational patterns: matched the input data against constants using comparison operations (<, >, <=, or >=).

Several changes were introduced to improve performance and interaction. These included native-sized integers for use in low-level libraries, function pointers, the option to disable the localsinit flag, module initializers, and new features for partial methods.

Recent updates also focused on improving developer productivity and simplifying code readability and writing. For example:

  • new() expressions;
  • static anonymous methods;
  • target-typed conditional expressions;
  • support for the GetEnumerator() extension in foreach loops;
  • lambda expressions with discard parameters;
  • the ability to apply attributes to local functions.

Note. We published a full-fledged article with a description of C# 9 features. You can read it here.

Same year: .NET Core evolves into .NET

Back in 2015, the first version of Microsoft's new .NET Core 1.0 was released. Unlike the .NET Framework, which at the time included only a few open-source components, .NET core was fully open-source. Though, the main difference between .NET Core and the .NET Framework was that .NET Core was designed to be cross-platform.

The last version of .NET Framework—4.8—was released in 2019, and it has not received updates since. In 2020, .NET Core changed its name to .NET and began introducing brand-new features that had never been part of the .NET Framework.

2021: C# 10

In November 2024, C# marked a milestone with the release of version 10, which introduced a range of enhancements for structs.

Developers got the opportunity to initialize fields directly within a struct body and use default parameters. The introduction of record structs was another notable enhancement.

Interpolated string handlers, types that convert an interpolated string to the resulting one, were added. Now, the compiler checked whether the interpolated string was assigned to a type that satisfied the pattern for a same-name string handler.

File-scoped namespace declarations were introduced, allowing the namespace to be declared for the entire file. It reduced the number of indentations and improved the code readability.

Pattern matching also saw exciting updates, including list patterns. It was now possible to use patterns in the switch and if statements.

There were several updates for lambda expressions. For example, lambda expressions could now declare a return type. It also became possible to apply attributes to lambda expressions.

Asynchronous methods got a boost too—they gained more efficient memory and thread management.

Note. We published a full-fledged article with a breakdown of C# 10 innovations. You can read it here.

2022: C# 11

The next version of C# was released in November 2022.

This version brought some exciting changes to support generic math, including:

  • static abstract and static virtual;
  • unsigned shift left operator;
  • relaxed requirements for shift operators.

These updates made it possible to implement mathematical operations for interfaces like System.IAdditionOperators.

Raw string literals were introduced. They were similar to the @ identifier but had some differences:

  • when split into several lines, all spaces preceding the closing quotes were removed from the output string.
  • quotation marks could now be interpreted literally (as well as curly brackets during interpolation).

What's more, the expression within the interpolation now could be moved to a new line.

A new required modifier was introduced to ensure that fields and properties must be initialized within the constructor or initializer.

Structs could now initialize their members with default values.

Pattern matching improvements in this version extended to lists and arrays, which could now be used in pattern matching.

Starting with this version, the nameof operator could capture parameter names when used in a method or parameter attribute.

Note. We published a full-fledged article with a breakdown of C# 11 innovations. You can read it here.

Same year: MAUI

In 2022, the open-source MAUI framework was released, enabling developers to build both the graphical user interface (GUI) and business logic of applications using XAML and C#. With MAUI, the GUI could be defined in a consistent way across platforms using XAML files, while still allowing for platform-specific controls when needed.

The .NET MAUI platform featured a layout engine that was used to design pages with various navigation elements, like drop-down menus or panels. One of its key features was built-in data binding, which supported cleaner and more maintainable design patterns. Event handler configuration also became more flexible, helping improve the display of interface elements.

In addition, .NET MAUI provided cross-platform APIs to access native device features like GPS, accelerometers, batteries, and network status data. The platform also introduced cross-platform graphics support, allowing developers to draw shapes and images, as well as perform graphical object transformations.

2023: C# 12

The new version of C# was released in November 2023 and brought several significant improvements and innovations to the language.

One of the most notable quality-of-life enhancements was the introduction of primary constructors for classes or structures. This simplified object creation by eliminating the need for a separate constructor when properties could be initialized at the time of declaration.

Collection handling also saw significant improvements. The syntax became more concise—it resembled the one previously used for arrays, only with square brackets instead of curly braces. It made the code more readable and compact. Additionally, a new .. extension operator was added, making it easier to concatenate collections.

Anonymous functions received improvements as well. Parameter could now have default values, and the params keyword became supported in anonymous functions, allowing for more flexible parameter handling.

The using directive also became more powerful. Previously used for creating type aliases, it was no longer restricted in its usage, allowing type aliases to be handled with greater flexibility and convenience.

Starting with this version, nameof was extended to support instance class members even when used static methods, initializers, and attributes.

On the more technical side, inline arrays were introduced—fixed-size arrays allocated on the stack in a contiguous memory block. This improvement enabled more efficient memory usage and was especially beneficial in performance-critical scenarios, as it avoided heap memory allocation and reduced overhead.

Note. We published a full-fledged article with a description of C# 12 new features. You can read it here.

2024: C# 13

The latest version of C# at the time, released in November 2024, introduced another range of enhancements. Now developers could initialize objects using an implicit "from end" operator (^). Previously, object indexes could only be specified "from the beginning" during initialization.

Partial declarations and implementations within classes were extended. It was now possible to mark properties and indexers with the partial modifier.

This version also introduced support for collections—not just arrays—with the params modifier.

In the System.Runtime.CompilerServices namespace, new C# version introduced the OverloadResolutionPriorityAttribute attribute, which can be used to explicitly specify which of the overloads will be used first.

Microsoft didn't forget about thread synchronization: the traditional object-based lock was replaced by the full-fledged Lock class from the System.Threading namespace. Besides improving code readability, this class introduced the IsHeldByCurrentThread field that indicated whether the block was held by the current thread, Moreover, other useful methods were introduced:

  • Enter(): entered the block section.
  • TryEnter(): attempted to momentarily enter the locked section, if allowed.
  • return the result of the login attempt as bool.
  • EnterScope(): retrieved the Scope structure that could be applied with the using statements.
  • Exit(): exit from the block section.

The ref struct types could now implement interfaces, and a new allows ref struct anti-constraint was added, enabling instances of ref structs to be passed to template methods.

Support for ref local variables and instances of ref structures was added inside asynchronous methods.

Finally, both iterators and async methods gained support for the unsafe modifier, which allowed pointer operations. This required a safe context for constructs like yield return and yield break in iterators.

Note. We published a full-fledged article with a description of C# 13 new features. You can read it here.

Wrap-up

Speeding up the DeLorean and heading back to the future! This is the end of our journey through the development and evolution of the C# language.

Keep in mind, the events covered here reflect the author's perspective and might not be a 100% match for everyone's taste. So, feel free to share your thoughts and your own noteworthy moments in C# history in the comments.

See you on the next adventure!
"It's against reason," said Filby.
"What reason?" said the Time Traveller.
H. G. Wells