.NET Standard for C# 9.0

visibility 3,045 access_time 2 years ago languageEnglish timeline Stats
timeline Stats
Page index 4.79
more_horiz

In many solutions, .NET standard has been used to share code between .NET Framework and .NET Core projects. Since the release of .NET 5, you probably will think what is the .NET standard version for C# 9 language features.

Well, the answer is simple - there is no need to have another version of .NET Standard such as .NET Standard 3 or .NET Standard 5. The reason is that .NET 5 and its future versions are the unified .NET which can run all the supported platforms.

Current .NET Standard Project

The following project utilizes .NET Standard 2.1.

<Project Sdk="Microsoft.NET.Sdk">
	<PropertyGroup>
		<TargetFramework>netstandard2.1</TargetFramework>
	</PropertyGroup>
</Project>

Change to .NET 5

To utilize the new language features in C# 9.0, just simply change the target framework to .NET 5:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net5.0</TargetFramework>
  </PropertyGroup>
</Project>

References

copyright This page is subject to Site terms.
Like this article?
Share on

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

More from Kontext
C#: Get Index value in foreach Loop of IEnumerable
visibility 202
thumb_up 1
access_time 7 months ago
Connect to MySQL in .NET 5
visibility 2,873
thumb_up 1
access_time 2 years ago
Get Started on .NET 5 with Apache Spark
visibility 931
thumb_up 1
access_time 2 years ago
Get Started on .NET 5 with Apache Spark