.NET Core,.NET Framework和Xamarin有什么区别? [英] What's the difference between .NET Core, .NET Framework, and Xamarin?

查看:95
本文介绍了.NET Core,.NET Framework和Xamarin有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Microsoft现在在.NET系列中具有.NET Core,.NET Framework和Xamarin(Mono)。

Microsoft now has .NET Core, .NET Framework and Xamarin (Mono) in its .NET family.

这里似乎有很多重叠之处。这些类型的.NET有什么区别?什么时候应该选择在项目中使用.NET Core而不是.NET Framework或Xamarin?

There seems to be a lot of overlap here. What's the difference between these types of .NET? When should I choose to use .NET Core in my project, instead of .NET Framework or Xamarin?

推荐答案

根据文档,在以下6种典型方案中,应使用.NET Core而不是.NET Framework或Xamarin。 此处

You should use .NET Core, instead of .NET Framework or Xamarin, in the following 6 typical scenarios according to the documentation here.


1。跨平台需求



很显然,如果您的目标是拥有一个应能够在各种平台(Windows,Linux和MacOS)上运行的应用程序(网络/服务), .NET生态系统中的最佳选择是使用.NET Core作为其运行时(CoreCLR),并且库是跨平台的。另一个选择是使用Mono项目。

1. Cross-Platform needs

Clearly, if your goal is to have an application (web/service) that should be able to run across platforms (Windows, Linux and MacOS), the best choice in the .NET ecosystem is to use .NET Core as its runtime (CoreCLR) and libraries are cross-platform. The other choice is to use the Mono Project.

这两种选择都是开源的,但是.NET Core由Microsoft直接和正式支持,并且将有大量投资向前发展。

Both choices are open source, but .NET Core is directly and officially supported by Microsoft and will have a heavy investment moving forward.

在跨平台使用.NET Core时,Windows上的最佳开发体验是Visual Studio IDE,它支持许多生产力功能,包括项目管理,调试,源代码管理,重构,丰富的编辑功能,包括Intellisense,测试等。但是,在Mac,Linux和Windows上使用Visual Studio Code也支持丰富的开发,包括智能感知和调试。甚至Sublime,Emacs,VI等第三方编辑器也可以很好地工作,并且可以使用开源Omnisharp项目获得编辑器的智能感知。

When using .NET Core across platforms, the best development experience exists on Windows with the Visual Studio IDE which supports many productivity features including project management, debugging, source control, refactoring, rich editing including Intellisense, testing and much more. But rich development is also supported using Visual Studio Code on Mac, Linux and Windows including intellisense and debugging. Even third party editors like Sublime, Emacs, VI and more work well and can get editor intellisense using the open source Omnisharp project.

在构建面向微服务的系统时,该系统由多个独立的,动态可伸缩的,有状态的或无状态的微服务组成,您在这里拥有的最大优势是可以使用不同的微服务。微服务级别的技术/框架/语言。这样一来,您就可以在系统中的每个微区域中使用最佳方法和技术,因此,如果您要构建性能卓越且可扩展的微服务,则应使用.NET Core。最终,如果您需要使用任何与.NET Core不兼容的.NET Framework库,都没有问题,您可以使用.NET Framework构建该微服务,并且将来您可以用.NET替代它。核心。

When you are building a microservices oriented system composed of multiple independent, dynamically scalable, stateful or stateless microservices, the great advantage that you have here is that you can use different technologies/frameworks/languages at a microservice level. That allows you to use the best approach and technology per micro areas in your system, so if you want to build very performant and scalable microservices, you should use .NET Core. Eventually, if you need to use any .NET Framework library that is not compatible with .NET Core, there’s no issue, you can build that microservice with the .NET Framework and in the future you might be able to substitute it with the .NET Core.

您可以使用的基础架构平台很多。理想情况下,对于大型和复杂的微服务系统,应使用Azure Service Fabric。但是对于无状态微服务,您还可以使用其他产品,例如Azure App Service或Azure Functions。

The infrastructure platform you could use are many. Ideally, for large and complex microservice systems, you should use Azure Service Fabric. But for stateless microservices you can also use other products like Azure App Service or Azure Functions.

请注意,截至2016年6月,并非Azure内的所有技术都支持.NET Core但是,由于.NET Core已发布RTM,因此Azure中对.NET Core的支持将大大增加。

Note that as of June 2016, not every technology within Azure supports the .NET Core, but .NET Core support in Azure will be increasing dramatically now that .NET Core is RTM released.

当您的系统需要最佳的性能和可伸缩性时,无论您有多少用户,您都将获得最佳的响应能力,那么.NET Core在哪里和ASP.NET Core真的很出色。在相同数量的基础架构/硬件下,您可以完成的工作越多,最终用户获得的体验就越丰富-成本更低。

When your system needs the best possible performance and scalability so you get the best responsiveness no matter how many users you have, then is where .NET Core and ASP.NET Core really shine. The more you can do with the same amount of infrastructure/hardware, the richer the experience you’ll have for your end users – at a lower cost.

摩尔定律对单个CPU的性能改进已不再适用。但是,您需要在系统不断发展的同时做更多的工作,并且需要每天数量呈指数增长的日益苛刻的用户更高的可伸缩性和性能。最终,您需要提高效率,在各处进行优化并在计算机,VM和CPU内核的群集之间更好地扩展。这不仅仅是用户满意度的问题;这也会在成本/总拥有成本上产生巨大的差异。这就是为什么追求性能和可伸缩性很重要的原因。

The days of Moore’s law performance improvements for single CPUs does not apply anymore; yet you need to do more while your system is growing and need higher scalability and performance for everyday’ s more demanding users which are growing exponentially in numbers. You need to get more efficient, optimize everywhere, and scale better across clusters of machines, VMs and CPU cores, ultimately. It is not just a matter of user’s satisfaction; it can also make a huge difference in cost/TCO. This is why it is important to strive for performance and scalability.

如上所述,如果您可以将系统的一小部分隔离为微服务或任何其他松耦合的方法,这样做会更好,因为您不仅可以独立地发展每个小部件/微服务,并具有更好的长期敏捷性和维护性,而且还可以在微服务级别使用任何其他技术(如果需要)您需要做的是与.NET Core不兼容。最终,您将能够对其进行重构,并在可能的情况下将其引入.NET Core。

As mentioned, if you can isolate small pieces of your system as microservices or any other loosely-coupled approach, it’ll be better as you’ll be able to not just evolve each small piece/microservice independently and have a better long-term agility and maintenance, but also you’ll be able to use any other technology at a microservice level if what you need to do is not compatible with .NET Core. And eventually you’d be able to refactor it and bring it to .NET Core when possible.

使用.NET Core时,此方法是可选的。当然,您也可以使用完整的Visual Studio IDE。但是,如果您是想要使用轻量级编辑器并大量使用命令行进行开发的开发人员,则.NET Core专为CLI设计。它提供了所有受支持平台上都可用的简单命令行工具,使开发人员可以在开发人员,实验室或生产机器上进行最少的安装即可构建和测试应用程序。像Visual Studio Code这样的编辑器使用相同的命令行工具来获得开发经验。而且,像Visual Studio一样,IDE也使用相同的CLI工具,但将它们隐藏在丰富的IDE体验之后。开发人员现在可以选择他们想要与从CLI到编辑器再到IDE的工具链进行交互的级别。

This approach is optional when using .NET Core. You can also use the full Visual Studio IDE, of course. But if you are a developer that wants to develop with lightweight editors and heavy use of command line, .NET Core is designed for CLI. It provides simple command line tools available on all supported platforms, enabling developers to build and test applications with a minimal installation on developer, lab or production machines. Editors like Visual Studio Code use the same command line tools for their development experiences. And IDE’s like Visual Studio use the same CLI tools but hide them behind a rich IDE experience. Developers can now choose the level they want to interact with the tool chain from CLI to editor to IDE.

如果您希望能够安装依赖于.NET框架不同版本的应用程序,则需要使用.NET Core,它可以提供100%的并排,如本文档前面所述。

If you want to be able to install applications with dependencies on different versions of frameworks in .NET, you need to use .NET Core which provides 100% side-by side as explained previously in this document.

此外,您可能还需要阅读:

In addition, you may also want to read:


  1. 何时不使用.NET Core?

  2. 何时仍应使用.NET Framework 4.x而不是.NET Core?

  3. 何时应该使用Xamarin而不是.NET Core?

  1. When should I NOT use .NET Core?
  2. When should I still use .NET Framework 4.x, instead of .NET Core?
  3. When should I use Xamarin, instead of .NET Core?

这篇关于.NET Core,.NET Framework和Xamarin有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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