Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Monodevelop on Ubuntu Console.ReadLine doesn't work

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
like image 462
Nozim Avatar asked Dec 22 '22 11:12

Nozim


1 Answers

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

like image 148
jstedfast Avatar answered Dec 29 '22 15:12

jstedfast