Wednesday 18 March 2015

Day 2- Installing ASP.NET MVC 4

Software Requirements for ASP.NET MVC 4
ASP.NET MVC 4 runs on the following operating systems:
• Windows XP Service Pack 3, Windows Vista Service Pack 2, Windows 7, and Windows 8
• Windows Server 2003 Service Pack 2, Windows Server 2003 R2 (32-bit x86), Windows
Server 2003 R2 x64 editions, Windows Server 2008, Windows Server 2008 R2, and
Windows Server 2012
The minimum .NET version required is 4.0, and for development you need the following:
• Windows PowerShell 2.0. Windows PowerShell is a task-based, command-line shell and
scripting language designed especially for system administration. The built-in Windows
commands, known as cmdlets, help you to manage your Windows environment as well as
other applications installed, such as the database SQL Server.
• Either Visual Studio 2010 Service Pack 1, Visual Web Developer Express 2010 Service Pack 1,
Visual Studio 2012, or Visual Studio Express 2012 for Web. The Express editions are free
downloads, and the only difference from the paid versions is that they are missing certain
features, such as add-ins, an extended set of project templates, XML and UML features,
performance and analysis features, and so on.
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 2-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.
www.it-ebooks.info
Chapter 2 ■ Installing ASP.NET MVC 4
13
Figure 2-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-2. Click Close to return to the Web PI window.
Figure 2-1. Locating ASP.NET MVC 4 in Web PI for installation
Figure 2-2. Packages to be installed. The list of dependencies will vary based on what is already installed on the system
www.it-ebooks.info
Chapter 2 ■ Installing ASP.NET MVC 4
14
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-2.
The difference here is that you need to accept the licenses associated with the selected
components, as shown in Figure 2-3. Click the “I Accept” button and you are taken to the
second step, Install.
Figure 2-3. WebPI Prerequisites step
• Install: This step is simple and requires no interaction (see Figure 2-4). WebPI downloads the
required components and proceeds to install them. After everything is complete, you move
automatically to the Configure step.
www.it-ebooks.info
Chapter 2 ■ Installing ASP.NET MVC 4
15
• 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 2-5. Click “Finish” and the installation wizard will take you back to
WebPI, where you can select and install other components.
Figure 2-4. WebPI Install step
Figure 2-5. WebPI Finish step
www.it-ebooks.info
Chapter 2 ■ Installing ASP.NET MVC 4
16
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.
As described earlier in the chapter, the stand-alone installer is an executable file that you download from
http://bit.ly/DownloadMVC4, shown in Figure 2-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 2-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 2-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.
www.it-ebooks.info
Chapter 2 ■ Installing ASP.NET MVC 4
17
Installing ASP.NET MVC 4 Server Components
Let’s look now at the server that will host the application once we finish the development. Just as we needed to install
ASP.NET MVC 4 on the development machine in order to develop applications, we need to install it on the server so
that it can host the applications. In the server you also use one of the two available methods to install ASP.NET MVC 4,
the stand-alone installer or Web PI.
Installing ASP.NET MVC 4 on a server is different from installing it on your development machine in the sense that
the stand-alone installer (or WebPI) will skip installation of the development tools, recognizing that you’re installing
it on a server and that the operating system is different (e.g., Windows Server 2012). By making this distinction and
skipping unnecessary components, the server ends up having only the components that it needs to host and serve
ASP.NET MVC 4 applications.
An additional advantage of installing ASP.NET MVC 4 on the server is that the required assemblies are registered
in the Global Assembly Cache (GAC), which means that any web site that runs on ASP.NET MVC 4 in that server now
has the required assemblies available because the GAC works as a repository of assemblies for the whole server, not
just for individual applications
The limited component installation is also important for security and performance considerations, because
administrators don’t want any unnecessary software on the servers—and definitely don’t want development tools on
the server. The problem with installing development tools on the server is that they sometimes open network ports
and/or enable services that otherwise will be closed or turned off, and that increases the risks of security breaches
and performance problems.

1 comment:

  1. you can also see http://mvc4all.com for more examples..

    ReplyDelete