Which C# version .NET Core uses?

北战南征 提交于 2019-12-06 16:54:19

问题


I know that C# version depends on .NET Framework.

But .NET Core which version uses?

Particularly .NET Core 2? C#7?


回答1:


.NET Core 2.0 references Roslyn 2.3, which corresponds to Visual Studio 2017 version 15.3 and supports C# 7.1.




回答2:


The C# what's new version history page gives a list of all versions plus their associated Visual Studio and .NET core version:

  • C# 7.3 Visual Studio 2017 version 15.7, and in the .NET Core 2.1 SDK 2.1.300 RC1
  • C# 7.2 Visual Studio 2017 version 15.5, and in the .NET Core 2.0 SDK.
  • C# 7.1 Visual Studio 2017 version 15.3, and in the .NET Core 2.0 SDK.
  • C# 7.0 Visual Studio 2017 and .NET Core 1.0 and later

C# 8.0 is still in preview at this time (3-Jul-2019).

You can also see your SDK version with this command:

dotnet --info

Sample output:

.NET Core SDK (reflecting any global.json):
 Version:   2.1.300
 Commit:    adab45bf0c

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.13
 OS Platform: Darwin
 RID:         osx.10.13-x64
 Base Path:   /usr/local/share/dotnet/sdk/2.1.300/

Host (useful for support):
  Version: 2.1.0
  Commit:  caa7b7e2ba

.NET Core SDKs installed:
  2.1.300 [/usr/local/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]



回答3:


From Microsoft .net core whats new Page:

NET Core 2.0 supports C# 7.1, which adds a number of new features, including:

  • The Main method, the application entry point, can be marked with the async keyword.
  • Inferred tuple names.
  • Default expressions.


来源:https://stackoverflow.com/questions/45901362/which-c-sharp-version-net-core-uses

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!