Microsoft KB Archive/320607

= PRB: Dynamic Discovery Files Behave Differently When Located in Different Directories =

Article ID: 320607

Article Last Modified on 7/11/2005

-

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
 * Microsoft Visual Studio .NET 2003 Enterprise Architect

-



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:

 Download Metaacls.exe from the URL that follows:

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

cscript MetaACL [username] [permissions]

For example:

cscript metaacl.vbs &quot;IIS://Localhost/W3SVC&quot; ASPNET RWE

 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 &quot;IIS://Localhost/W3SVC/N&quot; 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.

<div class="status_section">

STATUS
This behavior is by design.

<div class="moreinformation_section">

Steps to Reproduce the Problem
 Make the changes that follow in the Machine.config file to enable dynamic discovery:  Open the Machine.config file that is located in the  \Microsoft.NET\Framework\<Version>\Config folder.</li>  To enable discovery, uncomment the add element that is under httpHandlers: </li> Make sure that the userName attribute is set to MACHINE in the processModel element.</li> Save the changes to the Machine.config file.</li></ol> </li> On the task bar, click Start and then click Run.</li> Type iisreset in the Open text box and then click OK.</li> Locate the Default.vsdisco file at:

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

</li> Copy the Default.vsdisco file to the Web root directory (c:\inetpub\wwwroot) .</li> Run Disco.exe on:

http://localhost/default.vsdisco

</li> Notice the error message that appears. This is the same error message that is mentioned in the &quot;Symptoms&quot; section.</li> Create a new Appdir in the WWWroot directory. Name the new Appdir Discovery .</li> Copy Default.vsdisco to the Discovery directory.</li> Run Disco.exe on:

http://localhost/discovery/default.vsdisco

</li> <li>Notice that Disco.exe now runs with no error message.</li></ol>

<div class="references_section">