.NET Core和Mono有什么区别?
我在官方网站上发现了一则声明:“为它编写的代码也可以跨应用程序堆栈移植,比如Mono。”
我的目标是使用c#, LINQ, EF7和Visual Studio创建一个可以在Linux上运行/托管的网站。
有人告诉我他想要“在Mono中”,但我不知道这是什么意思。我知道我想把。net Core 1.0和上面列出的技术一起使用。他还说他想使用“快速CGI”。我也不知道那是什么意思。
你能帮我理解这些术语吗?我的期望是否现实?
.NET Core和Mono有什么区别?
我在官方网站上发现了一则声明:“为它编写的代码也可以跨应用程序堆栈移植,比如Mono。”
我的目标是使用c#, LINQ, EF7和Visual Studio创建一个可以在Linux上运行/托管的网站。
有人告诉我他想要“在Mono中”,但我不知道这是什么意思。我知道我想把。net Core 1.0和上面列出的技术一起使用。他还说他想使用“快速CGI”。我也不知道那是什么意思。
你能帮我理解这些术语吗?我的期望是否现实?
当前回答
你不仅选择了一条现实的道路,而且可以说是微软强有力支持的最佳生态系统之一(也是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.
我希望这对你们有帮助
其他回答
在。net世界中有两种类型的clr,“完整”clr和核心clr,它们是完全不同的东西。
有两种“完整”的CLR实现,微软原生的。net CLR(用于Windows)和Mono CLR(它本身有用于Windows、linux和unix的实现(Mac OS X和FreeBSD))。一个完整的CLR就是你所需要的一切。因此,“完整的”clr往往尺寸较大。
Core CLRs are on the other hand are cut down, and much smaller. Because they are only a core implementation, they are unlikely to have everything you need in them, so with Core CLRs you add feature sets to the CLR that your specific software product uses, using NuGet. There are Core CLR implementations for Windows, linux (various) and unix (Mac OS X and FreeBSD) in the mix. Microsoft have or are refactoring the .NET framework libraries for Core CLR too, to make them more portable for the core context. Given mono's presence on *nix OSs it would be a surprise if the Core CLRs for *nix did not include some mono code base, but only the Mono community and Microsoft could tell us that for sure.
此外,我同意尼科的观点,核心clr是新的——我想它目前在RC2。我还不会依赖它来编写产品代码。
为了回答你的问题,你可以使用Core CLR或Mono在linux上发布你的网站,这是两种不同的方式。如果你现在想要一个安全的赌注,我会在linux上使用mono,然后如果你以后想移植,就移植到Core。
这个问题尤其实际,因为昨天微软正式宣布了。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中,所以你可以放心尝试。
这不再是。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
你不仅选择了一条现实的道路,而且可以说是微软强有力支持的最佳生态系统之一(也是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年),应该会更好。