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 Setup Procedure for the Windows Communication Foundation Samples to create the virtual directory. If you prefer to create the virtual directory manually, use the following procedure.
To create a virtual directory in IIS 5.1 or 6.0
Open a command prompt window and type start inetmgr to open the Internet Information Services (IIS) MMC snap-in.
In the left pane, expand the node with the computer's name, and then expand the Web Sites node.
Right-click Default Web Site and select New, Virtual Directory to open the Virtual Directory Creation wizard.
In the wizard, type servicemodelsamples as the alias for the virtual directory that you are creating.
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.Click Next.
By default, the following check boxes are selected: the Read and Run scripts (such as ASP) checkboxes.
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
Open a command prompt window and type start inetmgr to open the Internet Information Services (IIS) MMC snap-in.
In the left pane, expand the node with the computer's name, and then expand the Web Sites node.
Right-click Default Web Site and select Add Web Application to open the Add Web Application window.
In the window, type servicemodelsamples as the alias for the virtual directory that you are creating.
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.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
Right click the servicemodelsamples node and click Properties.
By default, the following check boxes are selected: Read, Log visits, and Index this resource.
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
Click the servicemodelsamples node.
Along the bottom of the window, two views are listed. Select Features View.
Double-click the entry for Directory Browsing.
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
Navigate to %SystemDrive%\inetpub\wwwroot\servicemodelsamples.
Right-click the servicemodelsamples folder and click Sharing and Security….
Click the Security tab.
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:
Click the Start menu and click Control Panel.
If you do not see the User Accounts icon click Switch to Category View.
Click the User Accounts icon.
Under "or pick a Control Panel icon," click User Accounts.
In the User Accounts dialog box, click the Advanced tab.
Click the Advanced button.
In the Local Users and Groups dialog box, click to expand the Users folder.
In the right pane, double-click Internet Guest Account.
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.
Close the Properties dialog box.
Close the Local Users and Groups dialog box.
Close the User Accounts dialog box.
Close the other User Accounts dialog box.
In the servicemodelsamples Properties dialog box, on the Security tab, click the Add button.
Type the name of the machine followed by a back slash, then paste the name of the Internet user account, for example, myMachineName\%InternetGuestAccountName%
Click the Check Names button to verify the addition. If it is valid, the name is in all caps and underlined.
For IIS 6.0, also check that NETWORK SERVICE is listed in the Group or user names box.
If NETWORK SERVICE is not listed:
Click the Add button.
In the Select Users or Groups dialog box, type the name of the machine followed by a backslash.
Type service after the backslash (no space).
Click the Check names button.
If multiple names are found, select NETWORK SERVICE and click OK.
Click OK to close the Select Users or Groups dialog box.
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:
On the Start menu, click Control Panel.
Click the User Accounts icon.
In the Group column, check that the value for ASPNET is "Users."
To set security properties of the folder in IIS 7.0
Navigate to %SystemDrive%\inetpub\wwwroot\servicemodelsamples.
Right-click the servicemodelsamples folder and click Share.
Click the down arrow to the left of the Add button.
Select the Find entry. The Select Users or Groups window opens.
Click the Advanced button.
Click the Locations button. The Locations window is now open.
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.
Click the Find Now button. This populates the search results with objects associated with the local computer.
Find the entry in the Name (RDN) column that begins with IUSR_. Select that entry and click OK to close the search results window.
Click OK to close the Select Users or Groups window.
Click Share to persist the changes.
- After the changes to enable sharing are complete, click Done to close the File Sharing window.
See Also
Concepts
Internet Information Service (IIS) Hosting Instructions
Send comments about this topic to Microsoft.
© Microsoft Corporation. All rights reserved.