c# programming monodevelop
I am learning to program in c# using monodevelop. I am follwing examples through the book c# programming for the absolute beginner.
I wrote the program:
// project created on 13/04/2006 at 15:33
using System;
namespace HelloWorld1
{
class MainClass
{
public static void Main(string[] args)
{
string username;
Console.Write("Please enter name");
username = Console.ReadLine();
Console.WriteLine("Hi threre, [0}!", username);
Console.WriteLine("Please press enter");
Console.ReadLine();
}
}
}
The program compiles but doesn't run through. I get as far as enter name and on pressing return I get the following error message:
Unhandled Exception: System.FormatException: Input string was not in a correct format.
in <0x004fd> System.String:FormatHelper (System.Text.StringBuilder result, IFormatProvider provider, System.String format, System.Object[] args)
in <0x0002b> System.String:Format (IFormatProvider provider, System.String format, System.Object[] args)
in <0x00037> System.String:Format (System.String format, System.Object arg0)
in <0x00012> System.IO.TextWriter:Write (System.String format, System.Object arg0)
in <0x00014> System.IO.TextWriter:WriteLine (System.String format, System.Object arg0)
in <0x0002e> System.IO.SynchronizedWriter:WriteLine (System.String format, System.Object value)
in <0x00018> System.Console:WriteLine (System.String format, System.Object arg0)
in <0x00022> HelloWorld1.MainClass:Main (System.String[] args)
What does this mean??
Is it because I am following a microsoft code course, I thought that c# was the same and interchangable, between .net and mono.
Or am I missing a dependency??
Any help appreciated.
|