monodevelop cannot execute project

前端 未结 5 1442
情歌与酒
情歌与酒 2021-02-11 02:36

i have install monodevelop and write a hello world program in C# console but when in run configuration i choose run in external console check box and click on run button monodev

5条回答
  •  太阳男子
    2021-02-11 03:18

    I found a couple of ways around this:

    1. Instead of creating a console application, create a GTK 2.0 project. For example:

    using System;
    using Gtk;
    
    namespace Test
    {
        class MainClass
        {
            public static void Main(string[] args)
            {
                /*Application.Init();
                MainWindow win = new MainWindow();
                win.Show();
                Application.Run(); */
                Console.WriteLine("Hello World");
            }
        }
    }
    

    And in the Application Output pad, you will see "Hello World".

    1. install mono-runtime (sudo apt-get install mono-runtime) and go to the bin/Debug/ directory. There you will find an .exe file and you can simply execute it as ./{{NameOfProject}}.exe

提交回复
热议问题