TOP CENTER
     

16

How do I build a C# application using Visual Studio .NET "Whidbey"?   New Page 1
What is Object-Oriented Programming?
What is Microsoft .NET?
What is C#?
What is Common Language Runtime (CLR)?
What do you mean by .NET Framework Class Libraries?
What are Namespaces?
What are the requirements for developing a C# application?
What are the steps involved in developing a C# application?
What will happen after the compilation of a C# program?
What are Identifiers?
What are Keywords?
How do I begin programming with C#?
What are the different editors that are available for C# programming?
How do I build a C# application using Command Line Compiler?
How do I build a C# application using Visual Studio .NET 2003?
How do I build a C# application using Visual Studio .NET "Whidbey"?
 

Anand Narayanaswamy

Posted - February 05, 2005
 
Visual Studio .NET “Whidbey” is the next edition of Visual Studio .NET 2003. It has been released at the Professional Developers Conference (PDC) 2003 and is now in the alpha stage. Microsoft will add more enhancements and features to this product by collecting feedbacks from alpha testers. This FAQ delivers a sneak preview about the new and powerful development tool. You will learn how to accept user input and print the same on to the console using Visual C# “Whidbey”.

Where will I get Visual Studio .NET “Whidbey”?

Microsoft provided a copy of this product (bits) for all PDC 2003 attendees. You will get a copy of Whidbey directly from Microsoft if you are nominated as an alpha tester. Alternatively, you can request a copy of the PDC kit from your local MSDN Customer Service center if you have subscribed to MSDN Universal Subscription.

First, you have to launch Whidbey (Start | All Programs | Microsoft Visual Studio Whidbey | Microsoft Visual Studio codename Whidbey). You will be presented with a startup page. Select New Project from the File menu and choose Console Application from the Templates section. Be sure to select Visual C# from the Project Types area

Visual Studio "Whidbey" will automatically create a template for a console C# application as in Visual Studio .NET 2003. Delete the three comment statements below the Main() method and enter the code given in the listing given below

Listing 16.1

string x;
Console.WriteLine("Enter your name");
x = Console.ReadLine();
Console.WriteLine("Hello {0}",x);
Console.WriteLine("Press any key to exit");
Console.Read();


The first line declares a variable named x of data type string. The program then prompts you to enter a name. It reads the name using the ReadLine() method and prints it on the console. You will learn more about data types and variables in one of the later FAQs.

The coding part of this simple program is over. The next step is to execute the program by pressing either the F5 key or by selecting the Start option on the Debug menu. The final output will be like as shown in the figure

If you exit the project now, the IDE will ask you whether to save the project or not. Enter a desired project name and save the project to a location. You can also choose not to save the project by selecting the Discard option. If you would like to modify the program code, select the Cancel option so that you will be returned to the code editor.

Note that the above steps might very when Microsoft releases the beta and the corresponding final version of this product later on.  It is expected that Microsoft will ship Visual Studio 2005 sometimes in the end of 2005.