微软现在拥有。net Core、。net Framework和Xamarin (Mono)。

这里似乎有很多重叠。这些类型的。net平台有什么不同?什么时候我应该选择在我的项目中使用。net Core,而不是。net Framework或Xamarin?


当前回答

.NET Framework - Windows only legacy implementation by Microsoft of .NET. Introduced in 2002, being phased out. .NET 5 (successor to .NET Core 3.1) - modern reimplementation of .NET Framework aimed at replacing it, supports Windows, macOS and Linux. Introduced in 2016, further version might absorb Xamarin Xamarin - Mono with platform bindings to non-windows OS's and APIs and tools tailored to mobile app development (iOS, Android and recently desktop). Introduced in 2012. Mono is a non Microsoft implementation of .NET developed by community and introduced in early 2000s and competing with .NET Framework.

其他回答

. net框架工作用于windows基础应用程序。 . net核心框架工作用于跨平台基础应用程序。 Xamarin框架工作用于移动应用程序开发。

[截至2022年2月]

net框架

专有的框架 主要适用于Windows操作系统 4.8版本是它的最终版本。 对它的支持可能会在Windows 10(以及它的其他兄弟服务器)结束

.NET(以前的。net Core)

免费开源 跨平台的 .NET框架的继承者 目前。net 6是LTS版本

Xamarin的

免费开源 用于使用。net和c#构建Android和iOS应用程序 .NET的一部分

你可以参考这一行- ASP和ASP的区别。NET Core(。NET Core)和ASP。NET Core(。净框架)

Xamarin根本不是一场辩论。当您想要使用c#构建移动(iOS, Android和Windows mobile)应用程序时,Xamarin是您的唯一选择。

. net框架支持Windows和Web应用程序。今天,您可以使用Windows Forms、WPF和UWP在. net Framework中构建Windows应用程序。ASP。NET MVC用于在.NET Framework中构建Web应用程序。

. net Core是一种新的开源和跨平台框架,用于为所有操作系统(包括Windows、Mac和Linux)构建应用程序。仅限NET Core。UWP用于构建Windows 10目标Windows和移动应用程序。ASP。NET Core用于构建基于浏览器的web应用程序。

你想要更多的细节,请参考这个链接 https://blogs.msdn.microsoft.com/dotnet/2016/07/15/net-core-roadmap/ https://learn.microsoft.com/en-us/dotnet/articles/standard/choosing-core-framework-server

. net Core是你现在应该使用的。net的当前版本(更多的特性,修复的bug,等等)

Xamarin是一个提供用c#编写的跨平台移动问题解决方案的平台,所以你不需要在IOS和Android上单独使用Swift。

你应该使用。net Core,而不是。net Framework或Xamarin,根据这里的文档,在以下6个典型场景中。

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 Core? 什么时候我应该继续使用。net Framework 4。x,而不是。net Core? 什么时候我应该使用Xamarin,而不是。net Core?