Virtual Directory Setup Instructions

The Windows Communication Foundation (WCF) samples are intended to share a common virtual directory named servicemodelsamples that is mapped to the %SystemDrive%\inetpub\wwwroot\servicemodelsamples folder.

You can run the Setupvroot.bat and Cleanupvroot.bat files from the One-Time Set Up Procedure for the Windows Communication Foundation Samples to create the virtual directory. If you prefer to create the virtual directory manually, use the following procedures.

Procedures

To create a virtual directory in IIS 5.1 or 6.0

  1. Open a command prompt window and type start inetmgr to open the Internet Information Services (IIS) MMC snap-in.

  2. In the left pane, expand the node with the computer's name, and then expand the Web Sites node.

  3. Right-click Default Web Site and select New, Virtual Directory to open the Virtual Directory Creation wizard.

  4. In the wizard, type servicemodelsamples as the alias for the virtual directory that you are creating.

  5. Set the path to %SystemDrive%\inetpub\wwwroot\servicemodelsamples. Most of the WCF samples copy service executable files to this location when built.

    Note

    %SystemDrive% is usually C: or D:, depending on the drive location where IIS is installed.

  6. Click Next.

  7. By default, the following check boxes are selected:

    • Read

    • Run scripts (such as ASP)

  8. Click Next, then click Finish to complete the wizard.

    Note

    This task must be performed only once as all of the WCF samples use the same servicemodelsamples virtual directory.

To create a virtual directory in IIS 7.0

  1. From the Start menu, click Run, then type inetmgr to open the Internet Information Services (IIS) MMC snap-in.

  2. In the left pane, expand the node with the computer's name, and then expand the Sites node.

  3. Right-click Default Web Site, select Add Application to open the Add Application window.

  4. In the window, type servicemodelsamples as the alias for the virtual directory that you are creating.

  5. Set the physical path to %SystemDrive%\inetpub\wwwroot\servicemodelsamples. Most of the WCF samples copy service executable files to this location when built.

    Note

    %SystemDrive% is usually C: or D:, depending on the drive location where IIS is installed.

  6. Click OK. The Web application is now created for the WCF samples.

    Note

    This task must be performed only once as all of the WCF samples use the same servicemodelsamples Web application.

    Note

    For the purpose of this documentation, the term "virtual directory" is synonymous with "Web application".

In addition to creating the virtual directory, you must also set its properties to enable WCF services to run.

To set additional virtual directory properties in IIS 5.1 or 6.0

  1. Right click the servicemodelsamples node and click Properties.

  2. By default, the following check boxes are selected:

    • Read

    • Log visits

    • Index this resource

  3. Select the Directory browsing checkbox. This enables you to access the directory of the directory using Internet Explorer, which helps when debugging a service.

To set additional virtual directory properties in IIS 7.0

  1. Click the servicemodelsamples node.

  2. Along the bottom of the window, two views are listed. Select Features View.

  3. Double-click the entry for Directory Browsing.

  4. In the Actions pane, select the Enable option. This enables you to access the directory of the directory using Internet Explorer, which helps when debugging a service.

Finally, you must set the security properties of the servicemodelsamples folder to allow it to be accessed by others.

To set security properties of the folder in IIS 5.1 or 6.0

  1. Navigate to %SystemDrive%\inetpub\wwwroot\servicemodelsamples.

  2. Right-click the servicemodelsamples folder and click Sharing and Security….

  3. Click the Security tab.

  4. If you are using IIS 6.0, in the Group or user names box, check that Internet Guest Account is listed.

    If it is not listed:

    1. Click Start and click Control Panel.

    2. If you do not see the User Accounts icon click Switch to Category View.

    3. Click the User Accounts icon.

    4. Under "or pick a Control Panel icon," click User Accounts.

    5. In the User Accounts dialog box, click the Advanced tab.

    6. Click the Advanced button.

    7. In the Local Users and Groups dialog box, click to expand the Users folder.

    8. In the right pane, double-click Internet Guest Account.

    9. In the Properties dialog box, copy the name used as the Internet guest account. By default, the name begins with "USR_" followed by the name of the machine.

    10. Close the Properties dialog box.

    11. Close the Local Users and Groups dialog box.

    12. Close the User Accounts dialog box.

    13. Close the other User Accounts dialog box.

    14. In the servicemodelsamples Properties dialog box, on the Security tab, click the Add button.

    15. Type the name of the machine followed by a back slash, then paste the name of the Internet user account, for example, myMachineName\%InternetGuestAccountName%

    16. Click the Check Names button to verify the addition. If it is valid, the name is in all caps and underlined.

  5. For IIS 6.0, also check that NETWORK SERVICE is listed in the Group or user names box.

    If NETWORK SERVICE is not listed:

    1. Click the Add button.

    2. In the Select Users or Groups dialog box, type the name of the machine followed by a backslash.

    3. Type service after the backslash (no space).

    4. Click the Check names button.

    5. If multiple names are found, select NETWORK SERVICE and click OK.

    6. Click OK to close the Select Users or Groups dialog box.

  6. If you are using Windows XP SP2 with IIS 5.1, check that both Internet Guest Account and ASPNET are listed in the Group or user names box.

    Note that the ASPNET user may be a member of the built-in Users security group. If so, then if the Users group is listed in the dialog box, you do not need to add it as a separate item to the list of permitted users.

    To check if ASPNET is part of the Users security group:

    1. On the Start menu, click Control Panel.

    2. Click the User Accounts icon.

    3. In the Group column, check that the value for ASPNET is "Users."

To set security properties of the folder in IIS 7.0

  1. Navigate to %SystemDrive%\inetpub\wwwroot\servicemodelsamples.

  2. Right-click the servicemodelsamples folder and click Share.

  3. Click the down arrow to the left of the Add button.

  4. Select the Find entry. The Select Users or Groups window opens.

  5. Click the Advanced button.

  6. Click the Locations button. The Locations window is now open.

  7. Select the entry for the computer being used. It is important to select the local computer and not an entry for any domains or networks that are listed. Once selected, click OK.

  8. Click the Find Now button. This populates the search results with objects associated with the local computer.

  9. Find the IIS_IUSRS entry in the Name (RDN) column. Select that entry and click OK to close the search results window.

  10. Click OK to close the Select Users or Groups window.

  11. Click Share to persist the changes.

    1. After the changes to enable sharing are complete, click Done to close the File Sharing window.

See Also

Concepts

Internet Information Service Hosting Instructions