Monodevelop on Ubuntu Console.ReadLine doesn't work

旧城冷巷雨未停 提交于 2019-12-01 22:18:48

问题


I'm trying to develop on Mono platform on Ubuntu. But I got trouble on my first application :) Here is the code:

using System;
using System.Threading;

namespace threadings
{
class MainClass
{
    public static void Main (string[] args)
    {
        Console.WriteLine ("The start");
        string x=Console.ReadLine();
        Console.WriteLine(x);
        Console.WriteLine ("the end");
    }


}

}

And here is the result:

The start

the end

And no any string between them, and no reading from console happens, and I can't input anything. What is the problem? Maybe I do something wrong?

My environment:

Ubuntu: Linux nozim-desktop 2.6.32-32-generic-pae
MonoDevelop: 
        version: 2.2.1 
        Build date: 2010-03-09 16:12:25+0000

回答1:


MonoDevelop's default console doesn't support ReadLine(), but you can set an option in the project options to launch an external console instead.

Options / Run / General / Run on external console



来源:https://stackoverflow.com/questions/6806326/monodevelop-on-ubuntu-console-readline-doesnt-work

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