Does C# 7.0 work for .NET 4.5?

前端 未结 2 1234
庸人自扰
庸人自扰 2020-11-29 06:13

I created a project in Visual Studio 2017 RC to check whether I can use new C# 7.0 language features in a .NET Framework 4.5 project. It seems to me that after referencing <

2条回答
  •  悲&欢浪女
    2020-11-29 06:40

    Running a C# 7 compiled application on .NET 4.5 should be fine at this moment, but note that running ASP.NET applications that use ASP.NET Dynamic Compilation won't work on .NET 4.5 because the C# 7.0 compiler requires .NET 4.6 to run.

    Source: https://github.com/dotnet/roslyn/issues/17908:

    The C# 7.0 compiler (2.0 and higher) requires .NET 4.6 to run

    The information on https://www.nuget.org/packages/Microsoft.Net.Compilers/2.0.1 (about supporting .NET 4.5) seems to be outdated.

提交回复
热议问题