Ask the Expert: What's New in C# 10.0 with Mads Torgersen

Play Ask the Expert: What's New in C# 10.0 with Mads Torgersen

The Discussion

  • User profile image
    Andy J

    It's a real shame you can't add features to C# used with .NET 4.8 as I have a large complex codebase. Unfortunately I've used some third party WPF controls and can do without the huge hassle, or cost, of having to replace all these controls for versions that'll work with .NET 5/6. It essentially means newer versions of C# are only available to brand new projects.

  • User profile image
    zivkan
    @Andy J: The docs on C# language version explicitly says "you can change it by editing the csproj file". So, you can do that, or put it in a Directory.Build.props so all projects in the solution get it with a single definition. The linked docs give the specific syntax to use.
  • User profile image
    Mads​Torgersen
    @zivkan: This is true. It's not "supported" but it mostly just works. Some newer C# features rely on framework types or runtime features that aren't available in .NET 4.8. In those cases the compiler will give you an error, and you'll just have to stay away from those features.

Add Your 2 Cents