有人在大型或中型项目中使用过。net开源实现Mono吗?我想知道它是否已经为现实世界的生产环境做好了准备。它是否稳定、快速、兼容……足够用了吗?将项目移植到Mono运行时是否需要花费大量的精力,或者它是否真的足够兼容,只需要为微软的运行时编写代码就可以了?
当前回答
对于公认答案的建议现在有点过时了。
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).
其他回答
你知道Mono 2.0预览版对Windows Forms 2.0的支持有多好吗?
从我使用它的一小部分来看,它似乎相对完整,几乎可用。它只是在一些地方看起来不太对,总的来说还是有点命中或错过。说实话,它和我们的一些表格一样好用,这让我很惊讶。
这实际上取决于您从. net框架中使用的名称空间和类。我有兴趣将我的一个windows服务转换到我的电子邮件服务器(Suse)上运行,但我们遇到了几个尚未完全实现的api的硬障碍。Mono网站上的某个地方有一个图表,列出了所有的课程及其完成程度。如果你的申请被覆盖了,那就去申请吧。
当然,像任何其他应用程序一样,在做出全面承诺之前要进行原型设计和测试。
我们遇到的另一个问题是授权软件:如果您引用的是别人的DLL,那么您就无法通过编写代码来绕过隐藏在该程序集中的不兼容性。
对于公认答案的建议现在有点过时了。
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).
我个人在黄金时段使用Mono。 我运行单服务器处理千兆字节的udp/tcp数据处理相关任务,不能再高兴了。
有一些特殊之处,其中最烦人的事情之一是,由于Mono的当前状态,你不能“构建”你的msbuild文件:
MonoDevelop (the IDE) has some partial msbuild support, but will basically bork on any "REAL" build conf beyond a simple hello-world (custom build tasks, dynamic "properties" like $(SolutionDir), real configuration to name a few dead-ends) xbuild which SHOULD have been the mono-supplied-msbuild-fully-compatible-build-system is even more horrible, so building from the command line is actually a worse experience than using the GUI, which is a very "unorthodox" state of the union for Linux environments...
一旦/在你的东西真正构建的过程中,你可能会看到一些应该支持的代码的荒野:
编译器在某些构造上出错 一些更高级的/新的。net类向你抛出意想不到的垃圾(XLinq的人吗?) 一些不成熟的运行时“特性”(3GB堆限制在x64…WTF !)
但heaving表示,一般来说,事情很快就会开始起作用,而且解决方案/变通方法很多。
一旦你克服了这些最初的障碍,我的经验是,mono很摇滚,并在每次迭代中变得越来越好。
我有使用mono运行的服务器,每天处理300GB的数据,有大量的p/调用,通常来说要做大量的工作,并且保持5-6个月,即使使用“最先进的”mono。
希望这能有所帮助。
我们在一个需要在Linux上运行的项目中使用了它,但重用了我们在Managed c++中构建的一些。net库。我对它的成功感到非常惊讶。我们的主要可执行文件是用c#编写的,我们可以引用托管的c++二进制文件,没有问题。Windows和Linux之间c#代码的唯一区别是RS232串口代码。
我能想到的唯一大事件发生在大约一个月前。Linux版本有一个在Windows版本中看不到的内存泄漏。在做了一些手动调试之后(Linux上Mono的基本分析器没有多大帮助),我们能够将问题缩小到特定的代码块。我们最终修补了一个解决方案,但我仍然需要找一些时间回去,找出泄漏的根本原因是什么。
推荐文章
- 如何在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