在单跨平台正在开发? [英] Is developing in Mono cross-platform?

查看:178
本文介绍了在单跨平台正在开发?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在什么量度与单跨平台开发?我如何为Windows编译(在Linux中),我该如何在Linux下运行的东西(因为没有.NET JIT编译器)?

In what measure is developing with mono cross-platform? How do I compile for Windows (in Linux), how do I run things in Linux (because there is no .NET JIT compiler)?

那么,什么是的特殊性使用Mono开发?什么是过度使用Visual Studio开发的优势(除了跨平台thinghie)?

So what are the particularities of developing with Mono? What are the advantages over developing with Visual Studio (except cross-platform thinghie)?

推荐答案

在单声道发展绝对是跨平台以买者自负

Developing in Mono is definitely cross-platform with a caveat emptor:


  • 力求避开Windows特定的API

  • 与本机Windows API否互操作性......或者......你可以 #IFDEF 出的Windows API,为了最大限度地减少代码更改提供自己的单包装例如,有一个使用互操作调用Win32的方法,如GETFONT一个DLL包装,这是一个假设的例子,GETFONT将返回字体的信息,在Mono下,不存在,但是但是你可以创建一个假的包装不返回任何内容,并纳入了 #IFDEF 宏在Windows下进行编译时使用单声道下编译时的包装,并关闭宏,如何实现包装是由你

  • 请不要使用可能不会出现在单声道高级GUI属性。

  • 使用环境属性,如 NEWLINE ,使它的Unix的CR和Win32的CRLF,同样适用于路径分隔符,用于Unix'/'和Win32的'\'的独立。

  • 序列化是在Mono下略有不同,你自己序列化的单声道对象,不要孩子,以为在Win32下它会被反序列化,反之亦然。

  • Strive to steer clear of Windows specific APIs
  • No interoperability with the native Windows APIs... or... you can #ifdef out the Windows API and provide your own Mono wrapper in order to minimize code changes, for example, there's a DLL wrapper that uses Interop to invoke a Win32 method such as 'GetFont', this is a hypothetical example, GetFont will return the Font information, under Mono, that does not exist but however you can create a fake wrapper that returns nothing and incorporate the #ifdef macro to use the wrapper when compiling under Mono, and switch off the macro when compiling under Windows, how you implement the wrapper is up to you.
  • Do not use advanced GUI properties that may not be present in Mono.
  • Use the Environment property such as NewLine to make it independant of Unix's CR and Win32's CRLF, same apply for Path Separator, for Unix '/' and for Win32 '\'.
  • Serialization is slightly different under Mono, you serialize an object on Mono, do not kid yourself into thinking it will be de-serialized under Win32 and vice versa.

最后但并非最不重要,不断从单声道到Win32和再次检查,不断检验和测试。

Lastly but not least, keep checking from Mono to Win32 and back again, keep testing and testing it.

这篇关于在单跨平台正在开发?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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