FIX: The application configuration file cannot be downloaded from the Web server when you start a Web-based application that you deployed by using Internet Explorer (816762)



The information in this article applies to:

  • Microsoft .NET Framework 1.0

SYMPTOMS

When you try to start a Web-based application that has an application configuration file in Microsoft Internet Explorer, the application configuration file cannot be downloaded from the Web server.

CAUSE

This problem may occur when anonymous access is turned off on the Web server.

RESOLUTION

Hotfix information

A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that this article describes. Apply it only to systems that are experiencing this specific problem.

To resolve this problem, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

Prerequisites

The .NET Framework 1.0 Service Pack 2 is required before you can apply this hotfix.

To obtain the .NET Framework 1.0 Service Pack 2, visit the following Microsoft Web site:

Installation information

Install this hotfix on your client computer. Do not install this hotfix on your Web server.

File information

The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.

Date         Time   Version            Size    File name
---------------------------------------------------------------------------------
01-May-2003  12:42  1.0.3705.415       20,480  Perfcounter.dll  
01-May-2003  12:42  1.0.3705.415    1,175,552  System.dll       
01-May-2003  12:42  1.0.3705.415      311,296  System.runtime.remoting.dll  
01-May-2003  12:42  1.0.3705.415      503,808  System.web.services.dll  
01-May-2003  12:42  1.0.3705.415       61,440  System.web.services.resources.dll 

WORKAROUND

Warning This workaround may make your computer or your network more vulnerable to attack by malicious users or by malicious software such as viruses. We do not recommend this workaround but are providing this information so that you can implement this workaround at your own discretion. Use this workaround at your own risk.

To work around this problem, manually turn on anonymous access on the Web server.
  1. On the Web server, click Start, click Run, type inetmgr, and then click OK.
  2. Locate the Web site or the virtual directory, right-click the Web site or the virtual directory, and then click Properties.
  3. Click Directory Security, and then click Edit under Authentication and access control.
  4. Click to select the Enable anonymous access check box, and then click OK.
Note If you do not want to turn on anonymous access, install the hotfix to resolve this problem.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

Steps to reproduce the problem

To reproduce the problem, you must use a user account that belongs to the Administrators group on your computer.

Step 1: Create a Microsoft Windows-based form application that has an application configuration file

  1. Start Visual Studio .NET.
  2. On the File menu, point to New, and then click Project.
  3. Click Visual C# Projects under Project Types, and then click Windows Application under Templates. Name the project Q816762.
  4. In Solution Explorer, right-click the project name, and then click Add New Item.
  5. In the Add New Item list, select XML File.
  6. In the Name box, type App.config, and then click Open.
  7. Double-click the App.config file to open it.
  8. Replace the code in the App.config file with the following code.
     <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
       <appSettings>
          <add key="Key0" value="Hello world!" />
       </appSettings>
    </configuration> 
    
  9. Right-click Form1.cs in Solution Explorer, and then click View Code.
  10. Follow these steps:
    1. Locate the following statement in the code window.
      using System.Data;
    2. Add the following statement in the code window after the code that is described in step 10a.
      using System.Configuration;
  11. Double-click Form1.cs in Solution Explorer.
  12. Add a label control to Form1.
  13. Right-click Form1.cs in Solution Explorer, and then click View Code.
  14. Follow these steps:
    1. Locate the following statement in public Form1().
      InitializeComponent();
    2. Add the following statement in the code window after the statement that you located in step 14a.
      string  sAttr;
      sAttr = ConfigurationSettings.AppSettings.Get("Key0");
      label1.Text=sAttr;
  15. Press F5 to build and to run the application.

Step 2: Disable anonymous access in Microsoft Internet Information Services (IIS) 6.0

  1. Copy the Q816762.exe file and the Q816762.exe.config file that you created in the "Create a Microsoft Windows-based form application that has an application configuration file" section to the following location:

    Drive:\Inetpub\wwwroot

  2. Click Start, click Run, type inetmgr, and then click OK.
  3. Expand Computer name (local computer), expand Web sites, right-click Default Web Site, and then click Properties.
  4. Click the Directory Security tab in the Default Web Site Properties dialog box, and then click Edit in the Authentication and access control area.
  5. Click to clear the Enable anonymous access check box if it is selected.
  6. Click to select the Integrated Windows authentication check box if it is not selected.

Step 3: Run the application in Internet Explorer

  • Click Start, click Run, type http://localhost/q816762.exe, and then click OK.
You expect to see Form1 with the "Hello world!" string in it. However, Form1 does not contain a string.

REFERENCES

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

815786 How to store and retrieve custom information from an application configuration file by using Visual C# .NET

For additional information about how to deploy a .NET Framework-based application by using Internet Explorer, visit the following Microsoft Web site:

Modification Type:MinorLast Reviewed:10/18/2005
Keywords:kbHotfixServer kbQFE kbNetFrame100preSP3fix kbopenfile kbWebServer kbQFE kbfix KB816762 kbAudDeveloper