Support for C# 9.0

Hello,

we’ve recently updated to Unity 2021 LTS (2021.3.4f1).

The generated csproj files now contain the entry “9.0”.
Does this mean, C# 9 is supported? If so, all features or just a subset?

I couldn’t find much on the topic, just resources saying that Unity supports C# 8.

Additionally, I had to install .NET 6.0 so that Rider would run my unit tests.
This strikes me as odd, as Unity supports only .NET 2.1 which itself supports C# 8 afaik.

Thanks for your help!

Unity has a dedicated page for the C# compiler.
https://docs.unity3d.com/Manual/CSharpCompiler.html

As for the .NET profile it is .NET Standard 2.1.
https://docs.unity3d.com/Manual/dotnetProfileSupport.html

Also there was a big unity blog of what is planned
https://blog.unity.com/technology/unity-and-net-whats-next

5 Likes

Thanks a lot @MaskedMouse , this is exactly what I was looking for!