Introduction

So you want to be an ASP.NET MVC 4 developer, where should you start? Right here! In this tutorial I’ll show you how to get up and running with ASP.NET MVC 4 by setting up your first application. Let’s get started!

Visual Studio

The first thing you’re going to need is a version of Microsoft’s Visual Studio. ASP.NET MVC 4 only works on Visual Studio 2012, 2010 and Visual Web Developer 2010 Express SP1, although on 2010 software you will need to install some additional components for the framework to function.

If you’re working on Visual Web Developer 2010 SP1 you’ll need the following:

If you’re working with Visual Studio 2010:

Visual Studio 2012 will come with ASP.NET MVC 4 pre-packaged, so no need for component installs.

If you don’t have a copy of Visual Studio, Microsoft offers a free version of Visual Studio 2012 Express.

(You may be required to specify which version of express you need, based on the platform you are developing for.)

Getting Started

I’ll be using the full version of Visual Studio 2012 for this tutorial, but it should be easy to follow along using an alternate version listed above.

Start by opening Visual Studio and selecting New Project from the Start page. Or you can use File > New Project from any other view.

Start your MVC 4 Project.
Click to enlarge

Project Details

You have two choices when it comes to choosing a server side language in ASP.NET, those choices are Visual Basic and C#. Visual Basic is more of a beginner’s language so we’ll choose C#. Navigate the tree on the left to the Visual C# tab and select Web. Then select ASP.NET MVC 4 Web Application. At the bottom you can enter the name of your project and the location in which to store the project. We’re going to name the application MyFirstApp and leave the default project location. Click OK.

Select your application type.

In the New ASP.NET MVC 4 Project dialog, select Internet Application. We’re going to leave the View Engine set to Razor.

New ASP.NET 4 MVC Project.

To learn the differences between Razor and the default ASPX View Engine, check out this article.

Default Application Template

Visual Studio has created a default template for your MVC 4 project. This means that it has automatically generated all of the required parts to have a simple working application.

ASP.NET MVC 4 Default Application Code
Click to enlarge.

You can view this application by navigating to Debug > Start Debugging, or pressing F5.

ASP.NET MVC 4 Default Application UI

Congratulations! You now have a working application template in ASP.NET MVC 4 using C#. This is a great place to start building out your application views and business logic. Visit Microsoft’s ASP.NET MVC 4 website to learn more.