aspnet / LibraryManager

MIT License
457 stars 83 forks source link

Use LangVersion=latest everywhere #736

Closed jimmylewis closed 7 months ago

jimmylewis commented 7 months ago

Many language features in recent .NET releases work fine on .NET Framework, but by default the compiler version used is based on the target framework during build. This means that in a multitargeted project, code for .NET Framework will use a different compiler version than code for .NET, which either prevents us from using newer features, or splits the codebase.

By using so targeting the latest version of C# everywhere, it allows us to leverage those new features regardless of framework. For any new features that have runtime requirements (i.e. are not compatible with .NET Framework), the compiler will issue an error anyway.