Raymond Raymond

.NET Standard for C# 9.0

event 2020-09-28 visibility 4,038 comment 0 insights toc
more_vert
insights Stats

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

More from Kontext
comment Comments
No comments yet.

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts