I began to study C#, but I ran into a problem. The ReadLine() method does not pause for user input. I just started C#, and it works on other people's programs, so I have no idea why. I am using Xamarin on a Mac.
Here is an example code that does not work:
using System;
namespace LearningC
{
public class LearningSharp
{
public static void Main (String[] args)
{
Console.WriteLine (Console.ReadLine ());
}
}
}
I found out the solution. Right click on your project and select Options. Then, select General under the Run tab and check "Pause console output" ("Run on external console" must be checked for this to work.)
Maybe your Project is set to be a Windows application. Right click on your Project name, click properties and change output type to Console Application.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With