How to debug in Xamarin Studio using mono runtime on Windows

南楼画角 提交于 2019-12-08 05:16:06

问题


When I try to F5-debug in Xamarin Studio on Windows debugging starts using Microsoft.NET.

Any idea how to get Xamarin to use the mono 3.2.3 which I have installed on my machine?


回答1:


You can add Mono to the .NET Runtimes in Tools - Options - Projects - .NET Runtimes. There you can browse to your Mono installation and add it.

You then have a choice of whether to set it as the default or not.

If you do not set it as the default you will not debug your application with Mono when you select Run - Start Debugging but you can run with Mono by right clicking the project in the Solution window and selecting Run With - Mono.

If you set Mono to be the default runtime then you will build and debug with Mono. However you will need to disable building with MSBuild in the project options under Build - General - Use MSBuild build engine. Otherwise it will fail to build your project. With Mono being the default when you debug the application it should use Mono.

In your application you can then use the following code to check that you are running with Mono:

        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");


来源:https://stackoverflow.com/questions/25949137/how-to-debug-in-xamarin-studio-using-mono-runtime-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!