加入收藏 | 设为首页 | 会员中心 | 我要投稿 大庆站长网 (https://www.0459zz.com/)- 科技、智能边缘云、事件网格、云计算、站长网!
当前位置: 首页 > 综合聚焦 > Windows > 正文

强制Xamarin在Windows上使用Mono

发布时间:2020-08-05 06:28:10 所属栏目:Windows 来源:互联网
导读:我很困惑我的Xamarin项目是使用Mono框架还是MS .Net. 如果我使用此代码创建一个简单的控制台样式应用程序来检测是否在Mono中运行但是我说不是. using System;namespace ConsoleTest{ class MainClass { public static void Main(string[] args)

我很困惑我的Xamarin项目是使用Mono框架还是MS .Net.

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

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下运行.

回到Windows,在我的项目设置下 – >构建 – >一般 – > Target Framework设置为“Mono / .NET 4.0”.我不明白,这是否意味着它将使用Mono或.NET 4.0?

我想强迫它使用Mono框架!

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

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

(编辑:大庆站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读