Mono:在Windows上开发,在Linux上运行 [英] Mono: Developing on Windows, running on Linux

查看:146
本文介绍了Mono:在Windows上开发,在Linux上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Mono的新手.我想在Visual Studio下的Windows上开发Windows.Forms应用程序,但在Linux上执行.从Mono文档中,我不清楚:1)我应该引用Winforms dll的Mono版本还是Microsoft .NET版本? 2)我应该使用dmcs或Microsoft csc.exe进行编译吗?这两个编译器之间有什么区别?

I''m new to Mono. I want to develop a Windows.Forms application on Windows under Visual Studio but execute on Linux. From the Mono documentation it’s not clear to me: 1) Should I reference Mono version of Winforms dlls or Microsoft .NET version? 2) Should I compile with dmcs or Microsoft csc.exe? What are the differences between these two compilers?

推荐答案

从理论上讲,在"true" .NET中工作的任何东西在Mono中都将完全相同.
:laugh :: laugh :: laugh :: laugh :: laugh:

我练习,大部分会.其中一些将非常紧密地工作,一些将完全失败,而某些根本没有实现.

如果您坚持使用.NET 2.0,则大多数mono都将像魅力一样工作-当我遇到问题时,一直在Linux上为网站运行Mono,我没有在Winforms上尝试过.

如果您可以在Windows下以Mono为目标,而不是使用"true" .NET框架,那么您将更好地了解什么将立即生效,而下次将EXE转移到Linux机器上时,尝试运行它.从来没有尝试过,也不知道VS的效果如何.

听起来是负面的?有点,但这反映了我的经验.大部分情况下都是非常成功的,但是当代码在"true" .NET上运行正常时,然后在Mono下失败,并且花了很长时间尝试找出出了什么问题之后,便深感沮丧.
In theory, anything that works in "true" .NET will work exactly the same in Mono.

:laugh::laugh::laugh::laugh::laugh:

I practice, most of it will. Some of it will work pretty closely, some will fail completely, and some isn''t implemented at all.

Provided you stick to .NET 2.0 most of mono will work like a charm - when I have had problems is has been running mono on Linux for a website, I''ve not tried it for Winforms.

If you can target for mono under windows, rather than using the "true" .NET framework then you will get a better idea of what will and won''t work immediately, rather than when you next transfer your EXE to the Linux box and try to run it. Never tried that, and don''t know how well VS will work.

Sound negative? It is a bit, but it reflects my experiences. Very successful for the most part, but deeply frustrating when code works fine on "true" .NET then fails under Mono and you spend ages trying to work out what went wrong.


编译器是不同:一种是Microsoft专有的,另一种是开源Mono.
您可以在.NET上进行开发,而无需在Mono上重新编译即可运行.
您需要检查Mono文档的兼容性: http://www.mono-project.com/Compatibility [ ^ ].

主要思想是:CLI是ECMA和ISO中的标准化问题.参见 http://www.ecma-international.org/publications/standards/Ecma-335.htm [^ ] .特别是,该标准定义了.NET库的标准部分.
库的标准部分应在.NET和Mono之间兼容,请使用很多非标准库,包括System.Windows.Forms.我亲自开发了可立即在Mono上运行的.NET Forms应用程序.我尝试非常准确地做到这一点,从一开始就试图确定潜在的可移植性问题,并且对兼容性基本满意.在.NET v.3.5之前还不是很好,但是现在我没有任何抱怨.

—SA
The compilers are different: one it Microsoft proprietary, another on is Open Source Mono.
You can develop on .NET and run without recompilation on Mono.
You need to check Mono documentation for compatibility: http://www.mono-project.com/Compatibility[^].

Main idea is: CLI is the matter of standardization in ECMA and ISO. See http://www.ecma-international.org/publications/standards/Ecma-335.htm[^]. In particular, the standard defines standard parts of the .NET library.
The standard part of library should be compatible between .NET and Mono, please good deal of non-standard libraries, including System.Windows.Forms. I personally develop .NET Forms applications which run on Mono right away. I try to do it very accurately, trying to identify potential portability problem from the very beginning and basically satisfied with the compatibility. It was not so good before .NET v.3.5, but right now I do not have complains.

—SA


这篇关于Mono:在Windows上开发,在Linux上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆