且构网

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

将对面向 .NET Standard 2.0 的类库的引用添加到面向 .NET Standard 4.5 的 Xamarin PCL

更新时间:2022-11-05 16:33:10

不,支持 .net 标准 2.0 的 .net 框架的最低版本是 .net 4.6.1(使用 .net core 2.0 工具 vs 2017.3+).无论您使用什么工具,.Net 4.7.1 都真正支持 .net 标准 2.0.

No, minimum version of .net framework which supports .net standard 2.0 is .net 4.6.1 (with .net core 2.0 tooling of vs 2017.3+). .Net 4.7.1 has true support for .net standard 2.0 no matter what tooling you use.

.net standard 2.0 API 面很大,entity framework core 2.0和asp.net core 2.0都是基于.net standard 2.0 apis开发的.

.net standard 2.0 has a large API surface, entity framework core 2.0 and asp.net core 2.0 are developed based on .net standard 2.0 apis.

请注意,pcl 配置文件 111 代表 .net 4.5 和 Windows 8.1,它们共同支持 .net 标准 1.1.

Note that pcl profile 111 stands for .net 4.5 and Windows 8.1 and they support .net standard 1.1 in common.

由于最新的 xamarin forms 2.5 支持 .net standard 2.0,我建议您停止使用 PCL 项目,并在任何地方使用 .net standard 2.

As latest xamarin forms 2.5 supports .net standard 2.0, I recommend you to stop using PCL projects, and use .net standard 2 everywhere.

使用针对 android 和iOS 使用 .net 标准 2 和 ef core 2 + SQL lite https://github.com/ysmoradi/ToDo

Checkout my to do sample app with xamarin forms which targets both android & iOS using .net standard 2 and ef core 2 + SQL lite at https://github.com/ysmoradi/ToDo

您还可以针对 .net 框架库的 nuget 包,例如 https://github.com/davideicardi/DynamicExpresso 它适用于移动设备,但仅针对 .net 框架.您以前无法使用它,现在您可以使用了.

You can also target nuget packages of .net framework libraries such as https://github.com/davideicardi/DynamicExpresso It works on mobile, but it targets .net framework only. You weren't able to use that before, now you can.

如果您想将 pcl 库的 nuget 包添加到您的项目中,请查看 https://github.com/ysmoradi/ToDo/blob/master/src/ToDo/ToDo.csproj#L5

If you want to add nuget packages of pcl libraries to your project, take a look at https://github.com/ysmoradi/ToDo/blob/master/src/ToDo/ToDo.csproj#L5

所以,更新到 xamarin 表单 2.5,用 .net 标准 2.0 替换你的 pcl,你很高兴:)

So, update to xamarin forms 2.5, replace your pcl with .net standard 2.0 and you're good to go :)

Visual Studio 2017.5 使用 .net 标准而不是 pcl 创建项目,因为这是一个未来.

Visual studio 2017.5 creates projects using .net standard instead of pcl as this is a future.