c# - 不能使用特性“声明表达式”,因为它不是 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>
如果缺少,则添加一个新元素,使用更高的语言版本。
推荐阅读
- vaadin - Vaadin-10/12 网格组件渲染器性能问题
- visual-studio - 如何在 GitHub 存储库中包含没有大 .vs 文件夹的项目属性?
- unity3d - 多久调用一次 OnTriggerEnter2D?
- arrays - 如何在 VBA 中重新保存锯齿状数组(数组中的数组)?
- sql - How to store address in database
- java - 安卓。遍历父回收器时嵌套的recyclerview自行滚动
- ssl - 是否可以使用 Telegraf 配置安全(SSL)kafka?
- php - get data of rows that are not set as foreign key in Laravel
- php - 将单个 Laravel 通知标记为已读
- angular - Angular Material Sorting a number assending doesn't work