Bits & Bytes

Creating a C# Console Application in Visual Studio 2013

This post explains how to create a simple console application in C# and make it print out a message. Console applications are the simplest applications. So, this is the perfect place to start if you have no prior knowledge of C#.

  1. Navigate to the Start menu by left-clicking the Windows icon in the lower-left corner of your Desktop screen.
    Desktop
  2. Then left-click the down arrow in the lower-left corner to go the Apps section and find the Visual Studio 2013 icon.
  3. Left-click the Visual Studio 2013 icon to open the Visual Studio 2013 application.
    StartMenu
  4. Left-click FILE in the menubar, mouse over New in the submenu, and left-click Project in the submenu to open the New Project dialog.
    NewProject
  5. Select Installed->Templates->Visual C#->Windows in the left-hand pane.
    Installed_Templates
  6. Then left-click Console Application in the center pane.
    ConsoleAppplication
  7. If you want to accept the default project name and location, left-click the OK button to finish creating the console application. Otherwise, you can first:
    1. Set the name of the project in the field next to “Name:” near the bottom of the dialog.
    2. Select a location by left-clicking the “Browse” button.
  8. Now the project is created. To get the program to do something, add the line
    Console.WriteLine("God is Love!");

    to the code file “Program.cs” so that the final code looks like this:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    
    namespace ConsoleApplication {
        class Program {
            static void Main(string[] args) {
                Console.WriteLine("God is Love!");
            }
        }
    }
    
  9. To compile and run the program, left-click DEBUG in the menubar and left-click Start Without Debugging in the submenu.
    StartWithoutDebugging
  10. When the program finishes compiling and runs, a console window should open like this one with the message “God is Love!” inside of it.
    Output

Tags: , , , , , , ,

Michael Hall

By: Michael Hall

5 Responses to “Creating a C# Console Application in Visual Studio 2013”

  1. mohini says:

    DIFFERENT BETWEEN CONSOLE APPLICATIONS AND WINDOWS APPLICATION //////

  2. mohini says:

    Console applications are the simplest applications. So, this is the perfect place to start if you have no prior knowledge of C#.

  3. Geovana says:

    Getting an error on the VS2k8 Tools:1. Visual Studio 2008 RTM is not installed.2. The Web Authoring frueate of Visual Studio is not installed.3. A previous version of the Silverlight Runtime is installed.4. A previous version of the Silverlight SDK is installed.5. The Visual Studio Update KB949325 is installed.6. A previous version of Silverlight Tools is installed.None of those are true as far as I can tell, I just uninstalled everything (except VS2k8)and then installed fresh Anyone else experience this?

  4. Mrwan says:

    Hi Paul, First, you have to make sure that you don’t have those installers inllasted in your machine. If you are sure about that, you can extract silverlight_chainer.exe by using WinRAR. And Find the exe named VS_SilverlightTools_Beta1_Setup.exe under the extracted folder and run that exe.. Hi desopedr,Not yet, man. I have been busy with a lot of things lately.. Normally, I used to do Silverlight in my spare time. but now, My manager wants me to learn Workflow Foundation for company.. so, I have too many problems in managing my time..:( Anyway, I will try and will let you know as soon as possible.

  5. […] Creating a C# Console Application in Visual Studio 2013 […]

Leave a Reply

*

 

© 2007–2024 XoaX.net LLC. All rights reserved.