有人在大型或中型项目中使用过。net开源实现Mono吗?我想知道它是否已经为现实世界的生产环境做好了准备。它是否稳定、快速、兼容……足够用了吗?将项目移植到Mono运行时是否需要花费大量的精力,或者它是否真的足够兼容,只需要为微软的运行时编写代码就可以了?


当前回答

如果你想使用WPF,那你就不走运了,Mono目前还没有计划实现它。

http://www.mono-project.com/WPF

其他回答

MoMA是一个很好的工具,就像其他人建议的那样。目前最大的不兼容性来源是将DllImport(或P/Invoke)导入Win32库的应用程序。有些程序集没有实现,但大多数程序集仅适用于windows,在Linux上确实没有意义。我认为可以肯定地说,大多数ASP。NET应用程序可以在Mono上运行,只需进行有限的修改。

(披露:我为Mono本身做出了贡献,也编写了在Mono上运行的应用程序。)

Yes it definitely is (if you're careful though) We support Mono in Ra-Ajax (Ajax library found at http://ra-ajax.org) and we're mostly not having problems at all. You need to be careful with some of the "most insane things" from .Net like WSE etc, and also probably quite some few of your existing projects will not be 100% Mono compatible, but new projects if you test them during development will mostly be compatible without problems with Mono. And the gain from supporting Linux etc through using Mono is really cool ;)

我认为支持Mono的很大一部分秘密是从一开始就使用正确的工具,例如ActiveRecord, log4net, ra-ajax等。

在许多情况下,你可以获取现有的代码并在Mono上运行,特别是如果你正在移植一个ASP。网络应用程序。

在某些情况下,您可能需要全新的代码段才能使其工作。如果你使用System.Windows。例如,如果不修改表单,应用程序将无法工作。同样,如果您使用任何特定于windows的代码(例如,注册表访问代码)。但我认为最糟糕的是UI代码。这在麦金塔系统上尤其糟糕。

如果你想使用WPF,那你就不走运了,Mono目前还没有计划实现它。

http://www.mono-project.com/WPF

对于公认答案的建议现在有点过时了。

The windows forms implementation is pretty good now. (See Paint-Mono for a port of Paint.net which is a pretty involved Windows forms application. All that was required was an emulation layer for some of the P-Invoke and unsupported system calls). Path.Combine as well as Path.Seperator to join paths and filenames. The windows Registry is OK, as long as you are only using it for storing and retrieving data from your applications (i.e. you can't get any information about Windows from it, since it is basically a registry for Mono applications).