Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / General / December 2005

Tip: Looking for answers? Try searching our database.

basic console application compilation error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
david.woodger@gmail.com - 02 Dec 2005 02:13 GMT
I am trying to build a simple C# console application but it will not
compile.  VS doesn't recognize the "console" keyword. Here is the code:

using System;

namespace con_hello
{
    /// <summary>
    /// Summary description for Class1.
    /// </summary>
    class Class1
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main(string[] args)
        {
            //
            // TODO: Add code to start application here
            //
            console.writeline("hello");
        }
    }
}

and the error message generated is:

The type or namespace name 'console' could not be found (are you
missing a using directive or an assembly reference?)

What gives?
DKW - 02 Dec 2005 02:15 GMT
PS: I'm using Visual Studio .NET 2003
Ken Wilson - 02 Dec 2005 09:35 GMT
>I am trying to build a simple C# console application but it will not
>compile.  VS doesn't recognize the "console" keyword. Here is the code:
[quoted text clipped - 28 lines]
>
>What gives?

C# is a case-sensitive language.  Class names (Console) and names of
class methods (WriteLine) are usually written in Pascal casing, i.e
first letter of each word is uppercase.  In your program, if you
change the line where you are trying to invoke the console to what
follows your program should compile and run;

 Console.WriteLine("hello");

When you get a problem like this start by looking in the help for the
particular class you are trying to use, i.e. Console, to see how the
various members are spelled and how to use them.

Ken Wilson
Seeking viable employment in Victoria, BC
DKW - 03 Dec 2005 00:49 GMT
I knew the answer had to be simple!  Thanks for the answer Ken -- right
on the money!

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.