PRB: Dynamic Discovery Files Behave Differently When Located in Different Directories (320607)



The information in this article applies to:

  • Microsoft Web Services (included with the .NET Framework)
  • Microsoft Visual Studio .NET (2002), Professional Edition
  • Microsoft Visual Studio .NET (2002), Academic Edition
  • Microsoft Visual Studio .NET (2002), Enterprise Developer Edition
  • Microsoft Visual Studio .NET (2003), Enterprise Architect Edition

This article was previously published under Q320607

SYMPTOMS

You may notice that Dynamic Discovery files may behave differently when these files are located in different directories. This problem occurs when you use MACHINE as a user account for processModel in the Machine.config file. For example, if you run Disco.exe on Default.vsdisco that is located the in Web root directory, you may receive the following error message:

Access is denied

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Access is denied

CAUSE

When you use MACHINE as a user account for processModel in the Machine.config file, the ASP.NET worker process runs under the ASPNET user account. To locate the URLs of XML Web services that are located in the Web root directory, the ASPNET user account requires permissions on the Internet Information Services (IIS) metabase. By default, the ASPNET user does not have an Access Control Entry (ACE) in the IIS metabase Access Control List (ACL).

RESOLUTION

Add an ACE for the ASPNET user in the ACL. To do this, follow these steps:
  1. Download Metaacls.exe from the URL that follows:

    http://download.microsoft.com/download/iis50/Utility/1.0/WIN98/EN-US/Metaacl.exe
  2. Run Metaacls.exe to unpack Metaacl.vbs.
  3. Move to the command prompt and then find the folder where the Metaacl.vbs file is located.
  4. Type the following command to add an ACE for the ASPNET user:

    cscript MetaACL <metabase path> [username] [permissions]

    For example:

    cscript metaacl.vbs "IIS://Localhost/W3SVC" ASPNET RWE

  5. The command in step 4 may fail because of multiple Web virtual servers in the IIS metabase. If the command fails, use the command that follows:

    cscript metaacl.vbs "IIS://Localhost/W3SVC/N" ASPNET RWE


    Note Web virtual servers (Web sites) are identified in the IIS metabase by index numbers. The first Web server is 1, the second Web server is 2, and this system of identification continues up to the last Web server that you have configured to your computer. In the earlier command, N is from 1 to the number of Web servers that are configured on the computer.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce the Problem

  1. Make the changes that follow in the Machine.config file to enable dynamic discovery:
    1. Open the Machine.config file that is located in the <windows>\Microsoft.NET\Framework\<Version>\Config folder.
    2. To enable discovery, uncomment the add element that is under httpHandlers:
      <!--<add verb="*" path="*.vsdisco" 
      type="System.Web.Services.Discovery.DiscoveryRequestHandler, 
      System.Web.Services, Version=1.0.3300.0, Culture=neutral, 
      PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>-->
      
    3. Make sure that the userName attribute is set to MACHINE in the processModel element.
    4. Save the changes to the Machine.config file.
  2. On the task bar, click Start and then click Run.
  3. Type iisreset in the Open text box and then click OK.
  4. Locate the Default.vsdisco file at:

    <Program Files>\Microsoft Visual Studio .NET\Common7

  5. Copy the Default.vsdisco file to the Web root directory (c:\inetpub\wwwroot) .
  6. Run Disco.exe on:

    http://localhost/default.vsdisco

  7. Notice the error message that appears. This is the same error message that is mentioned in the "Symptoms" section.
  8. Create a new Appdir in the WWWroot directory. Name the new Appdir Discovery.
  9. Copy Default.vsdisco to the Discovery directory.
  10. Run Disco.exe on:

    http://localhost/discovery/default.vsdisco

  11. Notice that Disco.exe now runs with no error message.

REFERENCES

For additional information about the Web services Discovery tool (Disco.exe), click the following article number to view the article in the Microsoft Knowledge Base:

267904 SAMPLE: Metaacl.exe Modifying Metabase Permissions for the IIS Admin Objects

Content Maintenance:1810

Modification Type:MinorLast Reviewed:7/11/2005
Keywords:kbdownload kbWebServices kbDownload kbSecurity kbWebFolder kbWebServer kbDiscovery kbprb KB320607 kbAudITPRO kbAudDeveloper