.NET Core,.NET Framework和Xamarin有什么区别?

What's the difference between .NET Core, .NET Framework, and Xamarin?

现在安切洛蒂微软.NET .NET框架和核心,xamarin(单)在其家庭网络。

似乎有很多重叠。什么是"。NET类型之间的差异论文?当我应该选择在我的项目使用.NET的核心,而.NET框架或xamarin?


根据这里的文档,您应该在以下6个典型场景中使用.NET核心,而不是.NET框架或Xamarin。

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.

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

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.

2. Microservices

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.

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.

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.

3. Best performant and scalable systems

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.

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.

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.

4. Command line style development for Mac, Linux or Windows.

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.

5. Need side by side of .NET versions per application level.

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.

6. Windows 10 UWP .NET apps.

此外,您还可以阅读:

  • 我什么时候不应该使用.NET核心?
  • 我什么时候还应该使用.NET Framework 4.x而不是.NET核心?
  • 我什么时候应该使用Xamarin,而不是.NET核心?

  • 微软就是这样解释的:

    .NET Framework, .NET Core, Xamarin

    .NET框架是与Windows一起分发的.NET的"完整"或"传统"风格。当您构建桌面窗口或uwp应用程序,或使用旧的ASP.NET 4.6+时,请使用此选项。

    .NET核心是在Windows、Mac和Linux上运行的跨平台.NET。当您想要构建可以在任何平台(包括Docker容器内部)上运行的控制台或Web应用程序时,可以使用此功能。目前不包括UWP/桌面应用程序。

    Xamarin用于构建可在iOS、Android或Windows Phone设备上运行的移动应用程序。

    Xamarin通常在mono上运行,mono是一个.NET版本,在微软正式决定使用.NET核心跨平台之前,它是为跨平台支持而构建的。和Xamarin一样,Unity平台也运行在Mono之上。

    一个常见的混淆点是ASP.NET核心的位置。ASP.NET核心可以运行在.NET框架(Windows)或.NET核心(跨平台)之上,如此答案中所述:ASP.NET核心(.NET核心)和ASP.NET核心(.NET框架)之间的差异


    您可以在这一行中引用-ASP.NET核心(.NET核心)和ASP.NET核心(.NET框架)之间的差异

    .NET Framework, .NET Core, Xamarin

    Xamarin根本不是一场辩论。当你想使用C_构建移动(iOS、Android和Windows Mobile)应用程序时,Xamarin是你唯一的选择。

    .NET框架支持Windows和Web应用程序。现在,您可以使用Windows窗体、WPF和UWP在.NET框架中构建Windows应用程序。ASP.NET MVC用于在.NET框架中构建Web应用程序。

    .NET核心是新的开源和跨平台框架,用于为所有操作系统(包括Windows、Mac和Linux)构建应用程序。.NET核心仅支持UWP和ASP.NET核心。UWP用于构建Windows10目标窗口和移动应用程序。ASP.NET核心用于构建基于浏览器的Web应用程序。

    您想了解更多详情,请参阅此链接https://blogs.msdn.microsoft.com/dotnet/2016/07/15/net-core-roadmap/https://docs.microsoft.com/en-us/dotnet/articles/standard/choosing-core-framework-server


  • .NET是基于C语言的生态系统
  • .NET标准是.NET生态系统的标准(换句话说,规范)。
  • .Net Core Class Library is built upon the .Net Standard.
    .NET Standard you can make only class-library project that cannot be executed standalone and should be referenced by another .NET Core or .NET Framework executable project.If you want to implement a library that is portable to the .Net Framework, .Net Core and Xamarin, choose a .Net Standard Library

  • .NET框架是基于.NET的框架,它支持Windows和Web应用程序
  • (You can make executable project (like Console application, or ASP.NET application) with .NET Framework

  • ASP.NET是一种基于.NET框架构建的Web应用程序开发技术。
  • .NET核心也是基于.NET的框架。
  • It is the new open-source and cross-platform framework to build applications for all operating system including Windows, Mac, and Linux.

  • Xamarin根本不是一场辩论。当你想使用C_构建移动(iOS、Android和Windows Mobile)应用程序时,Xamarin是你唯一的选择。
  • See the version history of .NET


    2019年5月更新

    升级到下一版本.NET 5时,应使用.NET Core 3.0及更高版本,你只需要一个统一的平台。

    There will be just one .NET going forward, and you will be able to use it to target >Windows, Linux, macOS, iOS, Android, tvOS, watchOS and WebAssembly and more.

    Introducing .NET 5


    .NET核心是您现在应该使用的.NET的当前版本(更多功能、修复的错误等)。

    Xamarin是一个提供跨平台移动问题解决方案的平台,用C编码,这样你就不需要在iOS上单独使用swift,Android上也一样。