How to use MVC 3 dialog options with Visual Studio 2010

After creating a new MVC 3 application (described in the article How to create a basic MVC 3 application with Visual Studio 2010), you’ll be presented with an intermediate dialog with some MVC-specific options for how the project should be created, as shown in the next picture. The options you select from this dialog can set up a lot of the infrastructure for your application, from account management to view engines to testing.

ASP.NET MVC 3 Internet applicationp project template

ASP.NET MVC 3 Internet applicationp project template

First, you have the option to select from three preinstalled project templates:

– The Empty template: This template has the basic folders, CSS, and MVC application infrastructure in place, but no more. Running an application created using the Empty template just gives you an error message. The Empty template is intended for experienced MVC developers who want to set up and configure things exactly how they want them.

– The Internet Application template: This contains the beginnings of an MVC web application — enough so that you can run the application immediately after creating it and see a few pages. This template also includes some basic account management functions which run against the ASP.NET Membership system.

– The Intranet Application template: It was added as part of the ASP.NET MVC 3 Tools Update. It is similar to the Intranet Application template, but the account management functions run against Windows accounts rather than the ASP.NET Membership system.

The second option is on the New ASP.NET MVC 3 Project dialog is a View Engine drop-down (see in the next picture). View engines offer different templating languages used to generate the HTML markup in your MVC application. Prior to MVC 3, the only built-in option was the ASPX, or Web Forms, view engine. You can find mode details about view engines from the article Razor view engine in ASP.NET 4.0.

ASP.NET 4.0 Razor view engine

ASP.NET 4.0 Razor view engine

The third option deals with testing, as in the next picture, if you’re using either the Internet Application or Intranet Application templates.

Visual Studio 2010 test framework selection

Visual Studio 2010 test framework selection

After checking the Create a Unit Test Project box, you’ll have a few more choices:

– The first is simple: You can change the name of your unit test project to anything you want.

– The second option allows selecting a test framework, as shown in the next picture

Visual Studio 2010 Unit test

Visual Studio 2010 Unit test

Note: The Visual Studio Unit Test Framework is available only with Visual Studio 2010 Professional and higher versions. If you are using Visual Studio 2010 Standard Edition or Visual Web Developer 2010 Express, you will need to download and install the NUnit, MbUnit, or XUnit extensions for ASP.NET MVC in order for this dialog to be shown.