【问题标题】:Feature `declaration expression' cannot be used because it is not part of the C# 6.0 language specification不能使用特性“声明表达式”,因为它不是 C# 6.0 语言规范的一部分
【发布时间】:2021-05-19 16:35:05
【问题描述】:

我正在尝试在 Ubuntu Linux VPS 上构建 SLN 文件。但是,我遇到了一堆错误。

        networking/handlers/CreateGuildHandler.cs(42,77): error CS1644: Feature `declaration expression' cannot be used because it is not part of the C# 6.0 language specification
        networking/Client.cs(45,16): error CS1043: Invalid accessor body `=>', expecting `;' or `{'
        networking/Client.cs(46,25): error CS1043: Invalid accessor body `=>', expecting `;' or `{'
        networking/Client.cs(124,41): error CS1525: Unexpected symbol `when'
        networking/Client.cs(124,43): error CS1525: Unexpected symbol `<operator>'
        networking/Client.cs(142,74): error CS1644: Feature `declaration expression' cannot be used because it is not part of the C# 6.0 language specification
        networking/handlers/UsePortalHandler.cs(32,43): error CS1644: Feature `type pattern matching' cannot be used because it is not part of the C# 6.0 language specification
        networking/handlers/PlayerShootHandler.cs(23,96): error CS1644: Feature `declaration expression' cannot be used because it is not part of the C# 6.0 language specification
        networking/handlers/CreateHandler.cs(27,107): error CS1644: Feature `declaration expression' cannot be used because it is not part of the C# 6.0 language specification
        realm/entities/vendors/MerchantLists.cs(114,99): error CS1644: Feature `declaration expression' cannot be used because it is not part of the C# 6.0 language specification

请问我可以得到一些帮助吗?我环顾四周,没有一个答案有效。

【问题讨论】:

  • 嗯,你是怎么编译它的?您使用的是什么版本的编译器?您在项目文件中指定了什么语言版本?

标签: c# linux vps


【解决方案1】:

编译器知道它的含义,但不允许您使用它们,这意味着您拥有一个合适的编译器,但是:项目本身被设置为使用较低级别的语言版本。检查项目文件是否明确指定,或者:如果缺少,则添加新的&lt;LangVersion&gt; 元素,使用更高的语言版本。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-09-09
    • 2016-03-08
    • 1970-01-01
    • 2017-08-26
    • 2017-04-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多