Simple tutorial program does not work as expected

Asked by Tim Cuthbertson

I am a newbie with MonoDevelop and C#, but I am a programmer of long experience. I have just started using MonoDevelop 2.6 on Ubuntu 11.10 to try to learn C# programming. I am following a tutorial. The first program, Hello World, works exactly as expected.

However, the second program is supposed to write a prompt and accept some input from the user. The program runs to successful completion, but does not pause to accept the user input. It then prints the output as if a NULL input had been accepted. Here are the program lines giving the problem:

            Console.WriteLine("Please enter a new first name:");
            firstName = Console.ReadLine();
            Console.WriteLine("New name: " + firstName + " " + lastName);

It is the second line that is not behaving as expected. Is the tutorial wrong, or is MonoDevelop misbehaving?

Question information

Language:
English Edit question
Status:
Solved
For:
monodevelop Edit question
Assignee:
No assignee Edit question
Solved by:
Tim Cuthbertson
Solved:
Last query:
Last reply:
Revision history for this message
Tim Cuthbertson (ratcheer) said :
#1

More info: The program can be compiled at the command line using dmcs. The resulting .exe file runs as expected, pausing for and accepting user-entered input.

Revision history for this message
Tim Cuthbertson (ratcheer) said :
#2

Never mind.

After days of searching for a solution and even upgrading MonoDevelop to 2.8 and Mono to 2.10, I am told that the MonoDevelop console does not support accepting input. The documentation should be more up front about this. (I am also told that in Visual Studio, the console does accept input.)