且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Xamarin/Visual Studio 2017:为移动开发选择哪个 .net 版本?

更新时间:2023-02-27 15:12:08

背后的技术细节会给你一个很长的答案,但它可能不是 100% 正确.

The technical details behind would give you a long answer, but it might not be 100% correct.

Mono 支持多个 .NET 配置文件,但不是最新的

如果您今天(2018 年 2 月 6 日)使用 Visual Studio for Mac 创建 Mono 项目(例如控制台应用程序),您应该能够看到它支持的最新 .NET 配置文件是 4.7(应该是 4.7.0.NET Framework 匹配),C# 语言为 7.1.

If you use Visual Studio for Mac to create a Mono project (console app for example) today (Feb 6, 2018), you should be able to see the newest .NET profile it supports is 4.7 (should be 4.7.0 to match .NET Framework), and C# language is 7.1.

注意在 Windows 上,.NET Framework 4.7.1 已经过时,并且支持 C# 7.2.

Note on Windows, .NET Framework 4.7.1 is out, and C# 7.2 is supported.

Xamarin 使用最新的 Mono

您的移动应用(iOS 或 Android)的最终版本将捆绑最新的 Mono 运行时.因此,您可以使用的 .NET 配置文件和 C# 编译器将由 Mono 版本决定.

The final build of your mobile apps (iOS or Android) would bundle the latest Mono runtime. Thus, the .NET profile and C# compiler you can use would be determined by that Mono version.

因此,就您今天的情况而言,您应该能够针对 .NET 配置文件 4.7.0 和 C# 7.1.

So in your case today, you should be able to target .NET profile 4.7.0 and C# 7.1.