.NET Core和Mono有什么区别?

我在官方网站上发现了一则声明:“为它编写的代码也可以跨应用程序堆栈移植,比如Mono。”

我的目标是使用c#, LINQ, EF7和Visual Studio创建一个可以在Linux上运行/托管的网站。

有人告诉我他想要“在Mono中”,但我不知道这是什么意思。我知道我想把。net Core 1.0和上面列出的技术一起使用。他还说他想使用“快速CGI”。我也不知道那是什么意思。

你能帮我理解这些术语吗?我的期望是否现实?


当前回答

简单来说,

Mono是.Net框架的第三方实现 Linux / Android / iOs . net Core是微软自己的实现。

. net Core是未来。Mono最终会死。说到。net Core还不够成熟。我曾努力用IBM Bluemix实现它,后来放弃了这个想法。下来的时间(可能是1-2年),应该会更好。

其他回答

这不再是。net Core vs. Mono。这是统一的。

2020年11月更新- .NET 5发布,统一了。net框架和。net核心

.NET和Mono将统一到。net 6下,该版本将于2021年11月发布

. net6.0将增加net6.0-ios和net6.0-android。 特定于操作系统的名称可以包括操作系统版本号,例如net6.0-ios14。

查看以下文章:

https://devblogs.microsoft.com/dotnet/introducing-net-multi-platform-app-ui/ https://github.com/dotnet/maui

. net Core并不需要mono框架意义上的mono, . net Core是一个可以在包括Linux在内的多个平台上工作的框架。参考https://dotnet.github.io/。

然而。net核心可以使用mono框架。参考https://docs.asp.net/en/1.0.0-rc1/getting-started/choosing-the-right-dotnet.html(注意rc1 documentatiopn没有rc2可用),但是mono不是微软支持的框架,建议使用受支持的框架

现在实体框架7现在被称为实体框架核心,可以在包括Linux在内的多个平台上使用。参考https://github.com/aspnet/EntityFramework(回顾路线图)

我目前正在使用这两个框架,但你必须明白,它仍然处于发布候选阶段(RC2是当前的版本),在测试和发布候选阶段,已经有了巨大的变化,通常会让你摸不到头脑。

这是一个关于如何在Linux中安装MVC . net Core的教程。https://docs.asp.net/en/1.0.0-rc1/getting-started/installing-on-linux.html

最后,您可以选择Web服务器(我假设快速cgi引用来自Web服务器)在Linux上托管您的应用程序。下面是安装到Linux环境的参考点。https://docs.asp.net/en/1.0.0-rc1/publishing/linuxproduction.html

我知道这篇文章最后主要是文档的链接,但在这一点上,这些是你最好的信息来源。net core在。net社区中仍然是相对较新的,在它完全发布之前,考虑到发布版本之间的巨大变化,我会犹豫是否要在产品环境中使用它。

这个问题尤其实际,因为昨天微软正式宣布了。net Core 1.0的发布。假设Mono实现了大多数标准的。net库,Mono和。net core之间的区别可以通过。net Framework和。net core之间的区别来看出:

APIs — .NET Core contains many of the same, but fewer, APIs as the .NET Framework, and with a different factoring (assembly names are different; type shape differs in key cases). These differences currently typically require changes to port source to .NET Core. .NET Core implements the .NET Standard Library API, which will grow to include more of the .NET Framework BCL APIs over time. Subsystems — .NET Core implements a subset of the subsystems in the .NET Framework, with the goal of a simpler implementation and programming model. For example, Code Access Security (CAS) is not supported, while reflection is supported.

如果你需要快速发布一些东西,选择Mono,因为它是目前(2016年6月)更成熟的产品,但如果你正在构建一个长期的网站,我会建议。net Core。它是由微软官方支持的,考虑到微软在。net Core开发中所付出的努力,所支持的api之间的差异可能很快就会消失。

我的目标是用c#, LINQ, EF7, visual studio来创建一个网站 可以在linux中运行/托管。

Linq和Entity框架包含在。net Core中,所以你可以放心尝试。

你不仅选择了一条现实的道路,而且可以说是微软强有力支持的最佳生态系统之一(也是x平台)。

Update: Main doc about .Net platform standard is here: https://github.com/dotnet/corefx/blob/master/Documentation/architecture/net-platform-standard.md Update: Current Mono 4.4.1 cannot run latest Asp.Net core 1.0 RTM Although mono is more feature complete, its future is unclear, because MS owns it for some months now and its a duplicate work for them to support it. But MS is definitely committed to .Net Core and betting big on it. Although .Net core is released, the 3rd party ecosystem is not quite there. For example Nhibernate, Umbraco etc cannot run over .Net core yet. But they have a plan. There are some features missing in .Net Core like System.Drawing, you should look for 3rd party libraries You should use nginx as front server with kestrelserver for asp.net apps, because kestrelserver is not quite ready for production. For example HTTP/2 is not implemented.

我希望这对你们有帮助

简单来说,

Mono是.Net框架的第三方实现 Linux / Android / iOs . net Core是微软自己的实现。

. net Core是未来。Mono最终会死。说到。net Core还不够成熟。我曾努力用IBM Bluemix实现它,后来放弃了这个想法。下来的时间(可能是1-2年),应该会更好。