Getting Started with Visual Studio

We’re working on improving this page. Any suggestions?

Step 1 : Set up your IDE

by Nicole Bruck

Before Installing

Let’s ensure that our machine is ready for us to install Visual Studio 2017. We’re going to need to do some updates and make some room!

  • Open Settings/Control Panel and select Windows Update
  • Check for updates and install
  • Open “My Computer” in your File Explorer
  • Ensure that you have more than 7 GB available in a drive (recommended in your C:/ drive)

Download

Now let’s go get our Visual Studio 2017 download so that we can get ready to install!

Install

Pick which components you would like to install or use our “default install” to get the most common tools.

Launch

You’re ready to rock and roll! Feel free to explore or get a head start with our next tutorial: Build an App.

Step 2 : Build an App

Create

We’re going to create an app to display, “Hello, World!”, which we will write in C# and run on Windows, specifically a WPF app.

  • Select File → New → Project…

  • Choose the “WPF Application” project type and name it, “HelloWorld”

  • On the left side, select “Toolbox” to open
  • Choose the push pin icon on the top of the Toolbox window

Edit

We’re going to add a text area and button to our app. Then we’ll add an action to our button to display, “Hello, World!”

  • On the bottom of your XAML window, you’ll insert the following code between the “Grid” tags.

 

/
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:HelloWorld"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525">

<Grid>
<Button x:Name="button" Content="Talk to me." HorizontalAlignment="Left" Margin="220,175,0,0" VerticalAlignment="Top" Width="75"/>
</Grid>

<Window x:Class="HelloWorld.MainWindow"

  • Expand the MainWindow.xaml in your Solution Explorer and open MainWindow.xaml.cs
namespace HelloWorld
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}

private void button_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show("Hello, World!");
}
}
}


Build & Run

Now we’re going to build the project so we can make sure that all the code works.

Create

We’re going to create an app to display, “Hello, World!”, which we will write in C++ and run on Windows, specifically a Win32 Console App.

  • Select File → New → Project…

  • Choose the “Win32 Console Application” project type under the “Visual C++” node and name it, “HelloWorld”.

  • In the wizard, just select “Finish”

Edit

We’re going to add a line of code to display, “Hello, World!” and to do that, we also need to add references to the std library in the iostream header.

  • In the tab labelled, “HelloWorld.cpp”, add the following lines of code.
// HelloWorld.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
using the namespace std

int main()
{
cout << "Hello, World!";
getchar();
return 0;
}


Build & Run

Now we’re going to build the project so we can make sure that all the code works.

Create

We’re going to create an app to display, “Hello, World!”, specifically we’re going to create an ASP.NET Core Web App (using .NET Core 1.0).

  • Select File → New → Project…

  • Choose the “ASP.NET Core Web Application (.NET Core)” project type under the “Visual C#” node and name it, “HelloWorld”

Build & Run

Now we’re going to build the project.



Step 3: Debug & More

The Visual Studio debugger helps you observe the run-time behavior of your program and find issues. With the debugger, you can break execution of your program to examine your code, examine and edit variables, view registers, see the instructions created from your source code, and view the memory space used by your application.

Get started with the Debugger