简体   繁体   English

C#版本支持mono

[英]C# version support for mono

As I know mono supports C# 8(and all other previous versions) but mono project's official page says that latest version is C# 7 and it's implementation is even partial so what's happening is mono's website out of sync or I am misinformed about mono's compiler implementations of C#?据我所知 mono 支持 C# 8(和所有其他以前的版本)但是 mono 项目的官方 页面说最新版本是 C# 7 并且它的实现甚至是部分的所以发生的事情是单声道的网站不同步或者我被误导了单声道的编译器实现C#?

C# 8.0 is supported by .NET Core 3.x and .NET Standard 2.1. C# 8.0 受 .NET Core 3.x 和 .NET Standard 2.1 支持。 [1] Mono 6.4+ has partial support for the latter in that it apparently can load and run .NET Standard 2.1 code without an issue, but since a library targeting Standard 2.1 can normally only be referenced by other 2.1 libraries or a .NET Core 3+ executable, writing an application for Mono that can actually utilize .NET Standard 2.1 requires you to invoke the C# compiler manually. [1] Mono 6.4+ 部分支持后者,因为它显然可以毫无问题地加载和运行 .NET Standard 2.1 代码,但由于针对 Standard 2.1 的库通常只能被其他 2.1 库或 .NET Core 3+ 引用可执行文件,为 Mono 编写实际可以利用 .NET 标准 2.1 的应用程序需要您手动调用 C# 编译器。 [2] [2]

My personal guess is that since support for .NET Standard 2.1 (and by extension C# 8) is so extremely limited, they didn't bother including it in the official docs.个人的猜测是,由于对 .NET Standard 2.1(以及扩展名 C# 8)的支持非常有限,因此他们没有费心将其包含在官方文档中。

1 C# language versioning - C# Guide | 1 C# 语言版本控制 - C# 指南 | Microsoft Docs 微软文档

2 Clarify how to use .NET Standard 2.1 from Mono · Issue #1689 · do.net/standard · GitHub 2阐明如何使用 .NET Standard 2.1 from Mono · Issue #1689 · do.net/standard · GitHub


As a sidenote, their Compatibility page seems to indicate that C# 7 is fully supported.作为旁注,他们的兼容性页面似乎表明完全支持 C# 7。 If you'd like a proper answer as to why the two pages differ, I suggest you ask a question on their Issue tracker .如果您想正确回答为什么这两个页面不同,我建议您在他们的Issue tracker上提问。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM