.Net Core,Portable,Standard,Compact,UWP和PCL之间的区别? [英] Difference between .Net Core, Portable, Standard, Compact, UWP, and PCL?

查看:277
本文介绍了.Net Core,Portable,Standard,Compact,UWP和PCL之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我听说过

  • .Net Core
  • .Net Portable
  • .Net标准
  • .Net Compact
  • 通用Windows平台
  • 便携式类库

所有这些对我来说都是允许您定位多个平台的完整.Net的子集" .所以我的问题是

All of these were explained to me as "a subset of the full .Net that allows you to target multiple platforms". So my questions are

  1. 有什么区别!?
  2. 如果我想编写一个尽可能多的读者可以使用的库,请我需要使用其中的一个(emem(或多个)??


(我的具体情况:我有一个针对.Net 2.0,.Net 4.5和UWP.针对UWP,需要创建一个新的VS项目并链接所有现有文件,这是一个巨大的痛苦.我必须再次为.Net Standard执行!!)


(My specific situation: I have a library that targets .Net 2.0, .Net 4.5, and UWP. Targeting UWP required creating a new VS project and linking all the existing files, which is a huge pain. Now someone is telling me it doesn't work for PCL, and from the sound of it I have to do it AGAIN for .Net Standard!?)

推荐答案

我将首先回答您的第二个问题:

I'll answer your second question first:

我有一个针对.Net 2.0,.Net 4.5和UWP的库.针对UWP,需要创建一个新的VS项目并链接所有现有文件,这是一个巨大的痛苦.现在有人告诉我它不适用于PCL,而且从它的声音来看,我必须再次对.Net Standard执行此操作!?)

I have a library that targets .Net 2.0, .Net 4.5, and UWP. Targeting UWP required creating a new VS project and linking all the existing files, which is a huge pain. Now someone is telling me it doesn't work for PCL, and from the sound of it I have to do it AGAIN for .Net Standard!?)

如果我想编写一个对尽可能多的读者可用的库,我需要使用其中的一个(或多个)?

If I want to write a library that's usable to as large an audience as possible, which one (or more than one) of these do I need to use?

简短的回答:您应该定位netstandard.使用具有所有功能的最低版本您需要的API.您可以使用 API端口之类的工具来

Short answer: you should target netstandard. Use the lowest version that has all the APIs you need. You can use a tool like API Port to check your existing project for compatibility with a given netstandard version.

不幸的是,这种方法将遗留较旧的平台,在您的情况下是.NET 2.0.如果需要维护.NET 2.0支持,那么您将需要一个单独的项目(带有链接文件)来构建一个单独的.NET 2.0程序集.

Unfortunately, this approach will leave behind older platforms, in your case, .NET 2.0. If maintaining .NET 2.0 support is necessary, then you'll need a separate project (with linked files) to build a separate .NET 2.0 assembly.

详细信息...

有什么区别!?

What's the difference!?

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