Xamarin/Visual Studio 2017:为移动开发选择哪个 .net 版本? [英] Xamarin/Visual Studio 2017: which .net version to pick for mobile development?

查看:27
本文介绍了Xamarin/Visual Studio 2017:为移动开发选择哪个 .net 版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始使用 Visual Studio 2017/Xamarin 进行开发,目标平台是 Android 和 iOS.

I just started to develop with Visual Studio 2017 / Xamarin, Target platforms are Android and iOS.

我没有找到关于目标 .net 版本和 Android/iOS 版本之间是否存在任何依赖关系的参考.是完全不相关,还是有这样的表?

I found no reference about whether there is any dependency between the target .net version and the Android/iOS version. Are they completely unrelated, or is there such a table?

更多详情:

当我启动一个项目时,我需要指定一个.net框架版本,选择范围从2.0到4.6.1.在我构建它之前,为了让我指定一个正确的模拟目标,我需要指定一个目标 Android 版本(选择范围从 2.1 (API 7) 到 8.0 (API 27),iOS 也有类似的选择.

When I initiate a project, I need to specify a .net framework version, choices range from 2.0 to 4.6.1. Before I can build it, and to let me specify a correct target for simulation, I need to specify a target Android Version (choices range from 2.1 (API 7) to 8.0 (API 27), there is a similar choice for iOS.

理论上,由于 AFAIK Xamarin 自动将编译的应用程序与 .net 代码捆绑在一起(与 Windows 下发生的情况相反,其中 .net 框架必须作为单独的系统组件安装)任何组合都适用于任何目标操作系统,但是真的是这样吗?

Theoretically, since AFAIK Xamarin automatically bundles the compiled app with the .net code (contrary to what happens under Windows, where the .net framework must be installed as a separate system component) any combination ahould work with any target OS, but is this really the case?

谢谢阿明.

推荐答案

背后的技术细节会给你一个很长的答案,但它可能不是 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.

这篇关于Xamarin/Visual Studio 2017:为移动开发选择哪个 .net 版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆