首页 > 解决方案 > 不能使用特性“声明表达式”,因为它不是 C# 6.0 语言规范的一部分

问题描述

我正在尝试在 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#linuxvps

解决方案


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


推荐阅读