LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-13-2006, 10:14 AM   #1
liaty
Member
 
Registered: Oct 2005
Distribution: openSuse 10.1
Posts: 129

Rep: Reputation: 15
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.
 
Old 04-13-2006, 10:42 AM   #2
liaty
Member
 
Registered: Oct 2005
Distribution: openSuse 10.1
Posts: 129

Original Poster
Rep: Reputation: 15
Type error, sorry.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MonoDevelop and KDevelop Help pandorazbox Slackware 18 04-18-2006 06:33 AM
setting up MonoDevelop Nau Mandriva 5 01-15-2006 03:38 AM
MonoDevelop troubles nagromo Linux - Software 1 12-15-2005 03:23 AM
No Monodevelop for testing damienduff Debian 1 08-19-2005 10:12 PM
MonoDevelop gives conflicting results nagromo Linux - Software 0 12-11-2004 01:00 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration