Exercise 1: Configure ASP.NET on Server Core

Windows Server 2008 R2 Server Core includes subsets of the 2.0/3.0/3.5 .NET Framework. The Framework makes it possible to run an almost full-featured version of ASP.NET. However, there are specific limitations that you should take into consideration when working with ASP.NET on Server Core.

No MMC Snap-in. To configure, host, and manage Server Core hosted ASP.NET websites, you must do so via a remote connection from an IIS Management Console (i.e. MMC snap-in) running on a client computer. You can also manage practically every aspect of IIS sites and applications via a local administrative command console using the command line utility APPCMD.

No System.Web.Mail Namespace. The namespace System.Web.Mail is not supported because CDOSYS is not present on Server Core. The System.Web.Mail namespace was deprecated some time ago, so chances are that your code is no longer using them anyway. Use System.Net.Mail instead as it offers the same functionality.

The Web Application Tool (WAT) is not available on Windows Server 2008 R2 Core.

Part 1: Server Core Optional Features

  1. Locate the Hyper-V management console on your hands-on-labs host machine. Open the virtual machine console onto the Win2K8R2Core virtual machine.
  2. Logon to the provided Server Core machine, Win2K8R2Core, using account student1.
  3. At the command prompt, type the following command to see a list of enabled/disabled optional features:

    dism /online /get-features /format:table
    Note:
    Note that the Deployment Image Servicing and Management (DISM) utility is the primary feature management tool for modifying Server Core installations.

  4. Use the following command to determine more precisely the status of ASP.NET feature configuration.

    dism /online /get-features /format:table | find /I “ASP”

    Note:
    Note the resultant error message when attempting to install the ASP.NET feature without first installing dependent features.

  5. DISM provides a list of additional features that must first be enabled.

    dism /online /enable-feature /featurename:IIS-ASPNET

  6. Before installing the Web Server Role, IIS and dependencies, we must make sure that the .NET Framework is installed. To install the 2.0/3.0 .NET Framework, use the Deployment Image Servicing and Management (DISM) utility as follows. NOTE that the featurename field is case sensitive and must be typed exactly as illustrated.

    dism /online /enable-feature /featurename:NetFx2-ServerCore

    dism /online /enable-feature /featurename:NetFx3-ServerCore
  7. The optional server role that must be configured to enable ASP.NET on IIS 7 is called IIS-ASPNET. This role has various pre-requisites that must first be installed. The first one is the Web Server Role, which can be enabled via following command:

    dism /online /enable-feature /featurename:IIS-WebServerRole
    Note:
    Once you have enabled the IIS-WebServerRole, three additional roles must be installed prior to the installation of the IIS-ASPNET role:
    • IIS-ISAPIFilter
    • IIS-ISAPIExtensions
    • IIS-NetFxExtensibility
  8. These roles are installed by issuing the following commands (in corresponding order):

    dism /online /enable-feature /featurename:IIS-ISAPIFilter dism /online /enable-feature /featurename:IIS-ISAPIExtensions dism /online /enable-feature /featurename:IIS-NetFxExtensibility

  9. Now, install the IIS-ASPNET optional feature using the following command:

    dism /online /enable-feature /featurename:IIS-ASPNET

  10. Determine if the IIS service is running via the following command:

    sc query w3svc

Part 2: Install the IIS Management Services

At this point, your Server Core machine is capable of hosting ASP.Net applications. However, on Server Core, there is no IIS management console and no service running that may be leveraged from a remote management console. This means that if you want to create web sites and web applications, you would have two options. Either use appcmd.exe, a command line utility found within the Windows system folder, or, enable the IIS Management Service and use an IIS Management Console from a remote client machine.

  1. Let's choose the remote management console option and install the IIS Management Service as follows.

    dism /online /enable-feature /featurename:IIS-ManagementService

  2. You must also install the WAS-WindowsActivationService and the WAS-ConfigurationAPI as follows:

    dism /online /enable-feature /featurename:WAS-WindowsActivationService dism /online /enable-feature /featurename:WAS-ConfigurationAPI

  3. Once installed, you must do some registry hacking in order to enable the service. The following command will set a registry key value that allows the remote management service to be started:

    Reg Add HKLM\Software\Microsoft\WebManagement\Server /V EnableRemoteManagement /T REG_DWORD /D 1

  4. Although now enabled, the IIS Management Service is currently "stopped". Set the service to "started" using the following command:

    net start wmsvc

  5. Confirm that the management service is running using the following command:

    sc query wmsvc