Installing ASP.NET
The easiest way to install ASP.NET Framework is to install Visual Web Developer Express. You can download the latest version of Visual Web Developer from www.ASP.net, which is the official Microsoft ASP.NET website.
Installing Visual Web Developer Express also installs the following components:
- Microsoft .NET Framework version 4
- SQL Server Express
Visual Web Developer Express is compatible with the following operating systems:
- Windows XP (x86) Service Pack 3
- Windows XP (x64) Service Pack 2
- Windows Server 2003 Service Pack 2
- Windows Server 2003 R2
- Windows Server 2008 Service Pack 2
- Windows Server 2008 R2
- Windows Vista
- Windows 7
You can install Visual Web Developer Express on a computer that already has other versions of Visual Studio or Visual Web Developer installed. Different versions of the development environments can coexist peacefully.
Furthermore, the same web server can serve ASP.NET 1.1 pages, ASP.NET 2.0 pages, ASP.NET 3.0 pages, ASP.NET 3.5 pages, and ASP.NET 4 pages. Each version of .NET Framework is installed in the following folder:
C:\WINDOWS\Microsoft.NET\Framework
For example, on my computer, I have the following six versions of .NET Framework installed (version 1.0, version 1.1, version 2.0, version 3.0, version 3.5, and version 4):
C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705 C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 C:\WINDOWS\Microsoft.NET\Framework\v3.0 C:\WINDOWS\Microsoft.NET\Framework\v3.5 C:\WINDOWS\Microsoft.NET\Framework\v4.0.30128
All the folders except for v3.0 and v3.5 include a command-line tool named aspnet_regiis.exe. You can use this tool to associate a particular virtual directory on your machine with a particular version of .NET Framework.
For example, executing the following command from a command prompt located in the v1.0.3705, v1.1.4322, v2.0.50727, or v4.0.30128 folders enables the 1.0, 1.1, 2.0, or 4 version of ASP.NET for a virtual directory named MyApplication:
aspnet_regiis -s W3SVC/1/ROOT/MyApplication
By executing the aspnet_regiis.exe tool located in the different .NET Framework version folders, you can map a particular virtual directory to any version of ASP.NET Framework.
The .NET Frameworks 3.0 and 3.5 work differently than earlier versions. The 3.0 and 3.5 versions build on top of the existing .NET Framework 2.0. To use these versions of .NET Framework, you need to add the correct assembly references to your website and use the correct versions of the C# or VB.NET compilers. You reference these assemblies and configure the compiler within your application's web.config file. When you create a new website in Visual Web Developer, the necessary configuration settings are included in your web.config file automatically. The .NET Framework 4 is the first version since 2.0 that does not build off of a previous version.
You also have the option of targeting a particular version of .NET Framework. To do this, select Website, Start Options and select the Build tab. You can choose to target .NET Framework 2.0, .NET Framework 3.0, .NET Framework 3.5, or .NET Framework 4 (see Figure 1.17).
Figure 1.17 Targeting a particular version of .NET Framework.