如何解决无法使用功能“声明表达式”,因为它不是 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
请问我可以得到一些帮助吗?我环顾四周,没有一个答案奏效。
解决方法
编译器知道它的含义,但不让您使用它们这一事实意味着您有一个合适的编译器,但是:项目本身设置为使用较低级别的语言版本。检查项目文件以查看它是否明确指定,或者:如果缺少,添加一个新的 <LangVersion>
元素,并使用更高的语言版本。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。