If you’re an experienced software developer, there’s a good chance you’ve already used Visual Studio. If so, then you can skip this post; you won’t learn anything new here.
But you might be an experienced developer who’s never used Visual Studio. You might be wanting to move into web development with C# and ASP.NET after years of writing Java, C++, or VB6 code.
You might be an experienced PHP developer who’s never even seen Visual Studio.
Or you might be a student or a hobbyist, looking for your first software development position.
Whatever your reasons for being here are, we’ll start at the beginning.
An Overview of Visual Studio
And don’t confuse it with Visual Studio Code which – whilst getting better all the time – has only been around since 2015. This is essentially a free cross-platform text editor, also from Microsoft, but with support for projects, building, debugging, and is highly extensible; a scaled down Visual Studio, if you like.
What We’ll Be Doing
We’ll be installing Visual Studio Community 2017, and creating a .NET Core web application.
The Community edition is free and intended for students and individual developers rather than the enterprise. It’s fully functional, but lacks more advanced features.
We’ll be creating a .NET Core web application because, frankly, .NET Core is all the rage right now. If you don’t know anything about it, it’s the new cross-platform edition of .NET that currently runs on Windows, Linux, and Mac, has been written from the ground up, and provides a lean subset of the full .NET Framework. If you don’t know anything about the original .NET Framework itself, check out Microsoft’s overview.
Installing Visual Studio
First, you’ll need to download Visual Studio Community. Go to https://www.visualstudio.com/vs/community, then click “Download VS Community 2017”.
Run the downloaded executable file. After accepting the UAC prompt and clicking Continue on the first Visual Studio window, you’ll soon be presented with this page:
Check (tick) these four workloads:
- .NET desktop development;
- ASP.NET and web development;
- Asure development;
- .NET Core cross-platform development (scroll down for this one).
There’s no need to check anything else, but feel free to do so should you wish to look at other areas (such as game or mobile development).
Click Install. The Workloads page disappears, showing this:
You’ll need to wait a little while as the installation proceeds. How long depends on the workloads and components you selected, and how performant your machine is.
Eventually – assuming there were no hiccups – you’ll see this:
Click “Launch”. Then – on the following window – click “Not now, maybe later” (or – if you have a Microsoft account – you can sign in instead).
This is what you’ll normally see whenever you run Visual Studio:
To prove this, close Visual Studio, then find it in the Start Menu. Why would I lie?
Creating a New Project
Now it’s time to create a project. Click “Create new project…” underneath “New project” (near the middle of the window).
In the list of Installed Templates on the left, find and select .NET Core. Now select ASP.NET Core Web Application (.NET Core). I never use the default location (it’s too long and easy to forget!) so change it to somewhere more convenient – C:\Dev or C:\Projects are good suggestions. You can leave the name of the project as is.
Now click OK, and you’ll see…
Nothing should need changing; just ensure that Web Application is highlighted and that Authentication is set to No Authentication.
Click OK. The project has been created:
Press Ctrl+F5 to build and run the web application. After a short delay a web browser (*) should open, running the web application that Visual Studio just created for you:
(*) No flaming me for using Edge! I simply installed Visual Studio on a clean virtual machine.
That was easy, wasn’t it? Of course, it’s a default template so the website doesn’t really do much. But it’s a decent starting point, and you’ll probably use this a lot while you’re finding your feet.