How to Download and Installing Visual Studio

How to download, install and configure Visual Studio and take a look at some of the features of the development environment.

By Tim TrottC# ASP.Net MVC • October 10, 2008
1,681 words, estimated reading time 6 minutes.
How to Download and Installing Visual Studio

How to download, install and configure Visual Studio and take a look at some of the features of the development environment.

Installing Visual Studio

Visual Studio 2022 is one of the easiest releases to install. Download the bootstrapper, run and select the components you wish to use. We'll guide you through this process.

First, we need to check the system requirements. Visual Studio doesn't require a powerful machine, but it does require a significant amount of storage. You will need to be running Windows 7 or above.

You should have a 1.8 GHz or faster processor. A dual-core or better system is recommended, with 2 GB of RAM at the minimum. However, 4 GB of RAM is recommended for optimum performance. Hard disk space. This large application has all its supporting development frameworks, libraries and tools. Depending on the features installed, you will need up to 130 GB of available space; typical installations require 20-50 GB once installed. Install Windows and Visual Studio on a solid-state drive (SSD) to improve performance. Next, you will need a video card that supports a minimum display resolution of 720p (1280 by 720); Visual Studio will work best at a resolution of WXGA (1366 by 768) or higher. You will also require Administrator rights to install Visual Studio.

If your system meets all these requirements, we can go to the Microsoft website and download the installer.

Download Visual Studio

After downloading the file, run the bootstrapper file to install the Visual Studio Installer. This new lightweight installer includes everything you need to install and customize Visual Studio 2017. If you receive a User Account Control notice, click Yes.

Proceed to acknowledge the Microsoft License Terms and the Microsoft Privacy Statement and click Continue.

After installing the installer, you can customize your installation by selecting the feature sets you want.

After you select the workload(s) you want, click Install.

Next, status screens will appear, showing the progress of your Visual Studio installation.

After the new workloads and components are installed, click Launch.

At any time after installation, you can install workloads or components that you didn't install initially. If you have Visual Studio open, go to Tools > Get Tools and Features... which opens the Visual Studio Installer. Or, open Visual Studio Installer from the Start menu. You can select the workloads or components you wish to install from there, then click Modify.

Using the Visual Studio IDE

This tutorial will look at the Visual Studio Integrated Development Interface (IDE) and see how it makes our software development much easier. We will look at syntax highlighting, Intellisense and the toolbars. We will also look at different methods of running an application.

Syntax Highlighting

As you type the code in, Visual Studio will change the colour of the words. This is Syntax Highlighting, and it is there purely to aid readability.

In general:

  • Keywords are blue
  • Comments are green
  • Strings are red/brown
  • Classes are gray

You can change these colours within the program settings dialogue box if you prefer different colours.

IntelliSense

Using our Hello World application from the last tutorial, we will invoke IntelliSense and let it write code for us. If you typed in the code in the last tutorial, you will see IntelliSense; however, if you used copy and paste to insert the code, you will now see IntelliSense.

Start off my deleting the Console.WriteLine line, then just type 'C'. Notice a pop-up window with a list of items beginning with 'C'; also note that Console is the highlighted item. This is the item that Visual Studio thinks you are most likely to use in the current context. We can now press Enter or '.', and IntelliSense will type the rest of the word for you and bring up another selection box with WriteLine selected.

IntelliSense demonstration
IntelliSense demonstration

You can use the arrow keys to select different items on the list. Scroll up to C and notice that Console is not on the list anymore. This is because IntelliSense will only offer suggestions based on the current context. This little example will show all the methods and properties of the Console.

As we look at 'C' on the list, type in 'W', and the IntelliSense will return to WriteLine. We can see by the icon (see below for examples) that WriteLine is a method we can call, so type in an open parenthesis. Intellisense will now give you the method name, a description of what it does and the parameters that it takes. Notice in the top left that it says "1 of 19"; this function has been overloaded and can take many different types of parameters. Don't worry about this, but you can use the up and down keys to look through them.

If IntelliSense does not automatically pop up, you can use (Ctrl+Space) to have it pop up at the cursor.

IntelliSense Icons

Here are some common icons used in IntelliSense and what they mean. Don't worry if you don't understand the terms; they are all explained in later tutorials.

  • Classes
  • Methods
  • Properties
  • Namespace

Regions and Blocks

Visual Studio and Visual C# allow code sections to be hidden away or collapsed. A section of code between two braces is called a region and can be collapsed or expanded by using the plus or minus icon near the gutter. The gutter is the grey column down the left-hand side of the code window. We will see what the gutter is used for when we look at Debugging.

You can collapse block-level code that is nested within your methods, the namespace, or any block of code between the two.

The code does not get deleted; it is just hidden from view. This is very useful because it can hide away code you may not be interested in and de-clutter the code window, so all your attention is on the code you are writing.

You can also define your collapsible blocks of code by using the region and endregion keywords. To start a region, type #region , and at the end of the block of code, type #endregion. The editor will now allow you to collapse this code.

C#
#region myRegion
  Console.WriteLine("Please Enter Your Age:");  
  string myName = Console.ReadLine();
  Console.WriteLine("You Entered: " + myName);
#endregion

Visual Studio Task List

Visual Studio contains a nice feature called a task list. This view is similar to the Output view but shows all the tasks associated with the project or solution.

To view the task list, select View menu, then Task list (Ctrl+W, T). Tasks can be added with the "Create User Task" button and checked off when done.

Visual Studio Task List
Visual Studio Task List

However, the best feature for me is its ability to add and track TODO comments in your source code automatically. When coding, I often add a comment for things that need fixing or implementing in the future; the task list will pick up on these items so you can view them all and go directly to them.

C#
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;

namespace ConsoleApplication1
{
  class Program
  {
    static void Main(string[] args)
    {
      myArrayList myList = new myArrayList();
      // TODO: Genereate these dynamically
      myList.Add("iulwrg");
      myList.Add("3847987");

      Console.WriteLine(myList.ToString());
    }
  }

  class myArrayList : System.Collections.ArrayList
  {
    public override string ToString()
    {
      //HACK: This is a messy way, but it works for now. Make it better.
      string result = "";

      //UNDONE: Removed for testing
      //string[] theItems = (string[])base.ToArray(typeof(string));

      foreach (string item in theItems)
      {
        result += " " + item;
      }
      return result;
    }
  }
}

The task list view will scan this code and will pick up on the comment tags TODO, HACK and UNDONE.

You can define your tags from the options screen (Tools » Options » Environment » Task List »Task List Options and add a comment token with the appropriate priority). FIXME is my personal favourite.

Visual Studio Task List - Comment Tags
Visual Studio Task List - Comment Tags

XML Documentation in Visual Studio

Visual Studio provides the ability to generate project documentation using comments in the code with embedded XML tags. These can be easily converted to printable or human-readable documents using style sheets.

The code editor will automatically provide the XML tags; you only need to fill in the text as you code. XML documentation is slightly different from normal code comments in that it uses three forward slashes (///) instead of two. The editor will provide a list of tags, including a title and description for methods.

By typing /// in front of a method, the editor will auto-complete a basic documentation layout for that method.

C#
/// <summary>
///
/// </summary>
/// <param name="args"></param>
static void Main(string[] args)
{
}

All you need to do is fill in a summary of the method (what it does, what it is called by, any data it returns, etc.) and describe the parameters it takes.

Using IntelliSense (Ctrl+Space), you can bring up a list of tags that can be used, including examples. See also the permissions.

It is good practice to comment on your code as you progress.

A well-commented application permits a developer to fully understand the application's structure and how the various aspects interact. It also allows other developers to understand the project much quicker as they spend less time working out what everything does.

You can generate documentation by configuring the project properties when your code is complete and commented on.

Right-click the project in the Solution Explorer or select Properties within the Project menu. At the bottom of the build tab is an option to generate XML Documentation. Just enter a path for the documentation to be stored within. It will default to your project directory + "bin/debug/.xml".

You can also use the command line tool, csc.exe, to generate a documentation file:

csc program.cs /doc:my-xml-documentation.xml

Also the text within the

tags is used by IntelliSense as the method description when prompting for info in the code designer. If you are developing code that different people will reuse, it is highly recommended that each method has, at a minimum, a summary section.

IntelliSense demonstration
IntelliSense demonstration

The resulting XML from the documentation isn't very readable to humans, but we can use an XML transformation to generate an HTML version. There is a good example style sheet on codeproject.com to download and use.

Related ArticlesThese articles may also be of interest to you

CommentsShare your thoughts in the comments below

My website and its content are free to use without the clutter of adverts, popups, marketing messages or anything else like that. If you enjoyed reading this article, or it helped you in some way, all I ask in return is you leave a comment below or share this page with your friends. Thank you.

There are no comments yet. Why not get the discussion started?

New comments for this post are currently closed.