有人在大型或中型项目中使用过。net开源实现Mono吗?我想知道它是否已经为现实世界的生产环境做好了准备。它是否稳定、快速、兼容……足够用了吗?将项目移植到Mono运行时是否需要花费大量的精力,或者它是否真的足够兼容,只需要为微软的运行时编写代码就可以了?
当前回答
你知道Mono 2.0预览版对Windows Forms 2.0的支持有多好吗?
从我使用它的一小部分来看,它似乎相对完整,几乎可用。它只是在一些地方看起来不太对,总的来说还是有点命中或错过。说实话,它和我们的一些表格一样好用,这让我很惊讶。
其他回答
MoMA是一个很好的工具,就像其他人建议的那样。目前最大的不兼容性来源是将DllImport(或P/Invoke)导入Win32库的应用程序。有些程序集没有实现,但大多数程序集仅适用于windows,在Linux上确实没有意义。我认为可以肯定地说,大多数ASP。NET应用程序可以在Mono上运行,只需进行有限的修改。
(披露:我为Mono本身做出了贡献,也编写了在Mono上运行的应用程序。)
在桌面端,如果您承诺使用gtk#, Mono工作得很好。窗户。表单实现仍然有一些bug(例如,TrayIcon的不能工作),但它已经取得了很大的进步。此外,gtk#是一个比Windows窗体更好的工具包。
在web端,Mono已经实现了足够多的ASP。NET可以完美地运行大多数网站。这里的困难是找到一个在apache上安装了mod_mono的主机,或者如果你有shell访问你的主机,你自己做。
不管怎样,Mono都很棒,而且很稳定。
创建跨平台程序时需要记住的关键事项:
使用gtk#而不是Windows。形式 确保文件名的大小写正确 使用路径。分隔符而不是硬编码“\”,也使用环境。换行,而不是“\n”。 不要使用任何P/Invoked调用Win32 API。 不要使用Windows注册表。
请查看www.plasticscm.com。所有东西(客户端、服务器、GUI、合并工具)都是在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等。
对于公认答案的建议现在有点过时了。
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).
推荐文章
- 如何在Visual Studio中找到堆栈跟踪?
- 如何强制LINQ Sum()返回0而源集合是空的
- 如何创建数组。包含不区分大小写的字符串数组?
- 如何从字符串中删除新的行字符?
- 是否已经添加了事件处理程序?
- Lookup()和Dictionary(Of list()的区别
- 如何从我的c#代码运行EXE文件?
- Node.js vs .Net性能
- .NET控制台应用程序中的全局异常处理程序
- 枚举上最常见的c#位操作
- PowerShell脚本在机器上返回。net框架的版本?
- 用c#创建一个空文件
- 如何改变列表<T>数据IQueryable<T>数据
- 您可以使用反射来查找当前正在执行的方法的名称吗?
- 流。Seek(0, SeekOrigin.Begin)或Position = 0