强制Xamarin在Windows上使用Mono [英] Force Xamarin to use Mono on Windows

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

问题描述

对于我的Xamarin项目是使用Mono框架还是使用MS .Net一个框架,我感到困惑.

I'm confused as to whether my Xamarin project is using the Mono framework or the MS .Net one.

如果我使用此代码创建一个简单的控制台样式应用程序以检测是否在Mono中运行,但提示我不是.

If I create a simple console style app using this code to detect if running in Mono but says I'm not.

using System;

namespace ConsoleTest
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            Type t = Type.GetType("Mono.Runtime");
            if (t != null)
                Console.WriteLine("You are running with the Mono VM");
            else
                Console.WriteLine("You are running something else");
            Console.ReadLine();
        }
    }
}

在Mac OSX的Xamarin中运行的相同代码确实表明它在Mono下运行.

The same code running in Xamarin on Mac OSX does say it's running under Mono.

返回Windows,在我的项目设置下->构建->常规->目标框架设置为"Mono/.NET 4.0".我不明白,这是否意味着它将使用Mono或.NET 4.0?

Back on Windows, under my project settings -> Build -> General -> Target Framework is set to "Mono / .NET 4.0". I don't understand, does this mean it will use either Mono or .NET 4.0?

我想强迫它使用Mono框架!

I want to force it to use the Mono framework!

推荐答案

默认情况下,在Windows上XS使用.NET运行时,但是如果您安装了mono框架,则可以将默认运行时设置为"Mono",然后再次检查输出您的代码.

On windows by default XS uses the .NET run time but if you have installed mono framework you can set the default run time to "Mono" and again check output of you code.

您可以从此处将默认运行时间设置为单声道: 在Windows => Xamarin Studio =>工具=>选项=>项目和.NETRuntimes"

You can set default run time to mono from here: On windows => Xamarin Studio => Tools => Options => Projects and .NETRuntimes"

这篇关于强制Xamarin在Windows上使用Mono的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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