Contrary to the screenshot in the question, C# 8 is actually compatible with the .NET Framework. To use C# 8 with .NET Framework, simply set the language version to 8.0 in the .csproj file.
Most C# 8 functions, including static local functions, using declarations, and switch expressions, work properly in the target framework.
Async streams and indexes/ranges require new types not available in the .NET Framework. However, these features can be enabled using the "polyfill" NuGet package or a custom code file.
Default interface members are not supported and are never compatible with the .NET Framework because runtime changes are required in the CLR.
In Visual Studio 2019 16.3 and later, the language selection drop-down menu has been disabled and C# 8 must be enabled explicitly in the .csproj file.
While C# 8 is technically compatible with the .NET Framework, some features may be supported in limited support or additional workarounds are required. It is recommended to be cautious and thoroughly test any C# 8 code for the .NET Framework.
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3