【.Net Core】using declarations‘ is not available in C# 7.3. Please use language version 8.0 or greate

introduction

in.net core3.0, the using declaration is not available in C# 7.3 after it is used in the code. Please use language version 8.0 or higher.” The solution is

error message

CS8370

0

1

2 Feature ‘using declarations is not available in C# 7.3.please use language version 8.0 or greater.

3

4

Severity

Code

Description

Project

File

Line

Suppression State

6

Error

5

6 CNPCApi

7

D:\Project\NetCore\CNPCApi\CNPCApi\Program.cs

14

Active

solution

Add the following property node

to the solution file.csproj (right-click in explorer and edit via vs open) file

<PropertyGroup>
   <LangVersion>preview</LangVersion>
</PropertyGroup>
或
<PropertyGroup>
   <LangVersion>8.0</LangVersion>
</PropertyGroup>

add after save, recompile successfully, oh

Read More: