[Mono-list] Wrong error message given by mcs

Detlev Offenbach detlev@die-offenbachs.de
Fri, 10 May 2002 12:13:59 +0200

Content-Type: text/plain;
Content-Transfer-Encoding: 8bit


I am starting to learn C# using mono. The attached example taken from 
"Programming C#" doesn't compile as expected. However, the errormessage 
given by mcs (version 0.11) is not correct as it doesn't indicate the 
real problem of the code. The error I got was

./ex2-4.cs(5) error CS0103: The name `WriteLine' could not be found in 

What I expected was something saying that using is only allowed with 
namespaces and that Console is a class.

Detlev Offenbach
Detlev Offenbach

Content-Type: text/x-c++src;
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="ex2-4.cs"

using System.Console;
class Hello {
    static void Main() {
        // Console from the System namespace
        WriteLine("Hello World");