I'm using MonoDevelop to write C# (.NET) codes, on Ubuntu Desktop 14.0.5 LTS. While testing a simple Hello World
code, I encountered a problem - earlier on windows, I used the Console.ReadKey()
statement to make sure that the console doesn't disappear instantaneously after showing the output. However, this trick is not working on Ubuntu. Here's the code, in case you'd need to see it:
using System;
namespace Project_1 {
class MainClass {
public static void Main (string[] args) {
Console.WriteLine ("Hello World!");
Console.ReadKey ();
}
}
}
In spite of the last statement, the console shows up for about 1/100th of a second before disappearing. Precisely, the Console.ReadKey() statement is being ignored(??). I have no idea why this is happening. I'm new to using Ubuntu and installed MonoDevelop a few hours ago.
How do I fix this issue?