1.打开工程里的 projectName.csproj文件 2.加入一下内容即可 <PropertyGroup> <LangVersion>preview</LangVersion> </PropertyGroup>