Translate

How to Install ASP.NET MVC 4 Development Components?

One of the questions often asked by developers who are new to MVC is whether ASP.NET MVC 4 can run side by side with older versions of ASP.NET MVC. The answer is yes. After installing MVC 4, you can still create and work with applications using MVC 1, 2, and 3.

For your development environment, all versions of Visual Studio 2012 include ASP.NET MVC 4, so if you are using a version of Visual Studio 2012, you can skip ahead to the section “Visual Studio Application Templates.” If you are using Visual Studio 2010, you need to install ASP.NET MVC 4 separately. For this task, you can use either the Microsoft Web Platform Installer (WebPI) or the stand-alone installer.

• WebPI is a free, tiny (2MB) t • ool that allows you to download and install the latest components of the Microsoft Web Platform. Those components may be server components such as Internet Information Services (IIS), frameworks such as ASP.NET MVC or PHP, databases like SQL Server or MySQL, tools like Visual Studio Express 2012 and Microsoft WebMatrix 2,or even Windows Azure components like SDKs and libraries.

• The stand-alone installer is a single executable file that you download from Microsoft. The advantage of the stand-alone installer is that it works offline, so it can be used for distribution in corporate environments.

Personally, I like to use Web PI simply because it does all the work of finding any required dependencies and includes them for installation if they are not already present (and it does so in the correct order). Therefore, I’ll present that option first, and then present the option of using the stand-alone installer.

Using Web Platform Installer

As previously mentioned, all versions of Visual Studio 2012 already include ASP.NET MVC 4. If you instead have Visual Studio 2010 installed, either Express or another version, you need to follow the instructions in this section if you want to include support for developing ASP.NET MVC 4 applications.

You can download Web PI from http://bit.ly/DownloadWebPI. Once you have downloaded it, run the executable, which opens the interface shown in Figure 1. Note that WebPI’s interface is divided in three areas, top, middle, and bottom. The top area includes the general categories of components and a search box. The middle area is divided into two sections. The section on the left is a submenu of the category selected in the top area. Whichever item you select in the submenu filters the components available in the section on the right. The Install column on the right identifies whether the particular component is already installed on your system; if it isn’t, you can click the Add button to add the component to the list of components to install. Finally, the bottom area provides a summary count of the components to be installed, an Options link to further customize WebPI (such as the components feed and interface language), an Install button (which is enabled once there are components selected for installation), and an Exit button to quit the Web PI tool.



Figure 1. Locating ASP.NET MVC 4 in Web PI for installation

Figure 1 shows the Web Platform Installer window with the Products category selected. With the Products category selected, choose the Frameworks submenu, as shown, and scroll down the list on the right to find the component ASP.NET MVC 4 with Language Packs. The date of the installer release is indicated there too. Once you locate the component, click the “Add” button to its right to instruct WebPI that you want the component to be installed.

After you’ve added the component to the install list, you can click the link “Items to be installed” at the bottom of the window to see what exactly will be installed, including all the dependencies. The resulting window is shown in Figure 2. Click Close to return to the Web PI window.



Figure 2. Packages to be installed. The list of dependencies will vary based on what is already installed on the system

Now that everything is ready for installation, click the Install button to kickoff the installation, which is composed of four steps:

• Prerequisites: This step shows you what will be installed, just as you saw in Figure 2. The difference here is that you need to accept the licenses associated with the selected components, as shown in Figure 3. Click the “I Accept” button and you are taken to the second step, Install.



Figure 3. WebPI Prerequisites step

• Install: This step is simple and requires no interaction (see Figure 4). WebPI downloads the required components and proceeds to install them. After everything is complete, you move automatically to the Configure step.



Figure 4. WebPI Install step

• Configure: Depending on the selected components, additional configuration is required, such as the definition of a port to host an application or any other type of configuration. All that is done during the Configure step. Once all the configuration options are set, you are taken to the Finish step.

• Finish: This step shows the summary of the installations and offers you only one option, “Finish,” as shown in Figure 5. Click “Finish” and the installation wizard will take you back to WebPI, where you can select and install other components.



Figure 5. WebPI Finish step

Using the Stand-alone Installer

If you choose not to use the Web Platform Installer to install ASP.NET MVC 4, your other option with Visual Studio 2010 (either Express or another version) is to use the stand-alone installer.

Tthe stand-alone installer is an executable file that you download from http://bit.ly/DownloadMVC4, shown in Figure 6. The advantage of the installer file is that it runs offline, so after you download the file, you can disconnect from the Internet (if you need to) and share the file using any offline method, such as USB keys.



Figure 6. Download page for the stand-alone installer

After you download the file, just double-click it and it will run, as shown in Figure 7. The process is really simple. Select the “I agree to the license terms and conditions” check box to enable the Install button. Click the “Install” button, and the program handles all the installation tasks. When it finishes, it prompts you to exit.








Figure 7. The license agreement page of the stand-alone installer


No comments:

Post a Comment