本文介绍了编译C#飞的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可用于为MonoDroid的Andr​​oid设备上编写C#code?
我想在我的Andr​​oid平板电脑的飞行运行C#code时,MonoDroid的样子可能的解决办法,但我没有发现任何通知,如果MonoDroid的编译器只能在Windows / Mac或对Android太运行。

Can be used monodroid for compiling C# code on Android device?I would like run C# code on the fly on my Android tablet, the monodroid looks like possible solution, but I didn't found any notice if the monodroid compiler can run only on windows/mac or on the Android too.

推荐答案

我本来打算张贴此作为克里斯·辛克莱的回答评论,但想通这是要结束了足够长的时间,它可能也有一个单独的的回答。

I was originally going to post this as a comment on Chris Sinclair's answer, but figured it was going to end up long enough that it may as well be a separate answer.

我写C#去,所以我可以提供一些评论那里。事实上,它是使用单为Android写的。然而,这是不正确的说,单为Android做了转换或编译从C#为Java。在应用程序中的C#code的单声道运行时之上运行,并且可调用的接口用于运行时之间交谈来回(见了解关于它的更多细节)。

I wrote C# to Go, so I can provide some commentary there. It is in fact written using Mono for Android. However, it is not correct to say that Mono for Android does a conversion or compilation from C# into Java. C# code within an application runs on top of the Mono runtime, and callable interfaces are used to talk back and forth between runtimes (see this answer for more details on that).

回来时,我第一次发布的C#,去年去我写了的我怎么把它在一起。基本上,我使用的一个版本,我整理反对单为Android轮廓Mono的C#编译器的服务。所有应用程序的源代码是在GitHub上以及提供

Back when I first released C# to Go last year I wrote up a blog post describing how I put it together. Basically, I am using a version of Mono's C# compiler service that I compiled against the Mono for Android profile. All the source for the app is available on GitHub as well.

因为有一些问题,目前执行(其中一些是在博客中详细介绍)这不是一个完美的解决方案。目前,我无法支持创建/编译在应用类由于在单声道运行时出现问题。这是一个已经被固定在单声道的更高版本的文件化的问题,但由于单声道Android版尚客基于Mono 2.10它没有得到这些补丁。我的理解是,今年晚些时候Xamarin将开始把单为Android(也MonoTouch的)到单声道2.12也应该用它把这些修复工作,加右框中的C#编译器服务,避免需要把它作为一个独立的库,因为我做到了。

It's not a perfect solution as there are some problems with the current implementation (some of which are detailed in the blog post). Currently I'm unable to support creating/compiling classes in the app due to a problem in the Mono runtime. This is a documented problem that has been fixed in later versions of Mono, but since Mono for Android is still based off Mono 2.10 it has not gotten those fixes. My understanding is that later this year Xamarin will begin working on bringing Mono for Android (and also MonoTouch) up to Mono 2.12 which should also bring with it these fixes, plus the C# compiler service right in the box, avoiding the need to bring it in as a separate library as I did.

这篇关于编译C#飞的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!