Visual Studio LTSC 17.2 Feature 'static local functions' is not available in C# 7.3. Please use language version 8.0 or greater

huangapple go评论70阅读模式
英文:

Visual Studio LTSC 17.2 Feature 'static local functions' is not available in C# 7.3. Please use language version 8.0 or greater

问题

Error CS8370: 特性 '静态本地函数' 不可用于 C# 7.3。请使用语言版本 8.0 或更高版本。已升级 Microsoft Visual Studio,但错误仍然存在。

英文:

I am working in C# on the .NET Framework in the Console App for Microsoft Visual Studio. I am noticing the error below and I am unable to figure out where to fix that.

Severity Code Description Project File Line Suppression State
Error CS8370 Feature 'static local functions' is not available in C# 7.3. Please use language version 8.0 or greater.

I have updated Microsoft Visual Studio whereas the error still occurs.

答案1

得分: 1

根据madreflection所说,通常这种类型的错误“CS8370 功能 'XXXX' 在C# 7.3中不可用。请使用语言版本8.0或更高版本。”,只需在csproj中添加一行代码。

尝试在<PropertyGroup>节点下的ConsoleAppX.csproj中添加<LangVersion>8.0</LangVersion><LangVersion>preview</LangVersion>

英文:

As madreflection said, generally this kind of "CS8370 Feature 'XXXX' is not available in C# 7.3. Please use language version 8.0 or greater." error, just need to add a line of code in csproj.

Try adding &lt;LangVersion&gt;8.0&lt;/LangVersion&gt; or &lt;LangVersion&gt;preview&lt;/LangVersion&gt; in your ConsoleAppX.csproj under the &lt;PropertyGroup&gt; node.

huangapple
  • 本文由 发表于 2023年2月24日 07:52:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/75551429.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定