0

I am doing C# again since not touching it a few years. I can't seem to find information about what the minimal .NET requirements are for running a C#10 or 9 assembly. I.e. if I build a .NET core 3.1 project with C#10, will this work flawlessly with other assemblies that are using C# 8? I could try, but I also know that sometimes it will work until you use a feature where it suddenly doesn't.

Is there some matrix table that tells you exactly which version of C# is IL compatible with which .NET version?

  • C# version is independent of .Net version. – gunr2171 Dec 17 '21 at 00:28
  • Also see [What is the difference between C# and .NET?](https://stackoverflow.com/questions/2724864/what-is-the-difference-between-c-sharp-and-net) – gunr2171 Dec 17 '21 at 00:28
  • Also see [In Which .Net Framework Version C# 7.2 is Available](https://stackoverflow.com/questions/51155113/in-which-net-framework-version-c-sharp-7-2-is-available) – gunr2171 Dec 17 '21 at 00:30
  • 1
    Just use the [documentation](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/configure-language-version). It is otherwise a non-issue, you can no longer select the C# version. Project > Properties > Build tab, Advanced button, note the "Why can't I select a different C# version" link. – Hans Passant Dec 17 '21 at 00:49
  • Hmm not really. C# version isn't quite independent. For instance I can't use C#10 on .NET 2.0. I can also not use C#10 on .NET Core 3.1 apparently, but C#9 works, but is missing IsExternalInit, for instance, which you can then just add to your library and record types will work even on .NET Core 3.1. This is kindof a mess. I was expecting the boundaries not to be so blurry, but I guess then it's just really trial and error. I will go with C# 9 for now, since I need .NET Core 3.1 and can't use anything else. And then test frequently if it remains compatible with Unity 3D. – Catalina Iquita Dec 17 '21 at 01:15

0 Answers0