Search code examples
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#?


Solution

  • C# 8.0 is supported by .NET Core 3.x and .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.[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.

    1 C# language versioning - C# Guide | Microsoft Docs

    2 Clarify how to use .NET Standard 2.1 from Mono · Issue #1689 · dotnet/standard · GitHub


    As a sidenote, their Compatibility page seems to indicate that C# 7 is fully supported. If you'd like a proper answer as to why the two pages differ, I suggest you ask a question on their Issue tracker.