Microsoft KB Archive/833891

= How to resolve Retain in Memory and Unattended Execution problems in ActiveX controls that are running on IIS =

Article ID: 833891

Article Last Modified on 12/3/2007

-

APPLIES TO


 * Microsoft Internet Information Server 4.0
 * Microsoft Internet Information Services 5.0
 * Microsoft Internet Information Services 5.1
 * Microsoft Internet Information Services 6.0

-



We strongly recommend that all users upgrade to Microsoft Internet Information Services (IIS) version 6.0 running on Microsoft Windows Server 2003. IIS 6.0 significantly increases Web infrastructure security. For more information about IIS security-related topics, visit the following Microsoft Web site:

http://www.microsoft.com/technet/security/prodtech/IIS.mspx



SUMMARY
This article helps Web server administrators and developers to discover and to resolve problems with miscompiled Microsoft Visual Basic 6.0 DLLs.



MORE INFORMATION
Microsoft Internet Information Services (IIS) is a multi-threaded process that requires special consideration when you develop and use Visual Basic 6.0 DLLs.

Two properties of Visual Basic 6.0, the Retain in Memory property and the Unattended Execution property, must both be set to True to run in IIS. Miscompiled Visual Basic DLLs are the Visual Basic DLLs that are compiled with the Retain in Memory property set to False, with the Unattended Execution property set to False, or with both properties set to False.

For more informationabout the Retain in Memory property and the Unattended Execution property, click the following article number to view the article in the Microsoft Knowledge Base:

241896 Threading issues with Visual Basic 6.0 ActiveX components

Different symptoms may occur on your Web server if Visual Basic DLLs are miscompiled. For example, IIS may stop responding (hang), IIS may crash, or you may receive HTTP 500 error messages.

You can download and use the IIS Debug toolkit to determine if you have any loaded Visual Basic DLLs that are miscompiled. To download the IIS Debug toolkit, visit the following Microsoft Web site:

http://www.microsoft.com/downloads/details.aspx?FamilyID=01c4f89d-cc68-42ba-98d2-0c580437efcf&DisplayLang=en

To check these properties on your loaded Visual Basic DLLs, extract the toolkit files, and then run the following command on your Web server:

iisdump -s

This command generates a file that is named Sysinfo_ .xml. Scan the file for information that resembles the following: DLL Path=&quot;C:\INETPUB\WWWROOT\SIMPLE.DLL&quot; Version=&quot;1.0.0.0&quot; Timestamp=&quot;12/01/2004 15:08:42&quot; UnattendedExecution=&quot;false&quot; RetainInMemory=&quot;false&quot; If the Retain in Memory property is set to False or if the Unattended Execution property is set to False, the Visual Basic DLL is miscompiled.

If you have miscompiled Visual Basic DLLs, use one of the following methods to resolve the problem based on your version of IIS:

IIS 4.0
Make sure that the version of Msvbvm60.dll is 6.0.96.32 or later and that the file is dated June 21, 2002 or later. If you do not have this version or a later version of Msvbvm60.dll, you can update the Visual Basic runtime. To update the Visual Basic runtime, visit the following Microsoft Web site:

http://activex.microsoft.com/controls/vb6/vbrun60.cab

Note Alternatively, you can recompile the Visual Basic DLL with both the Retain in Memory property set to True and the Unattended Execution property set to True.

IIS 5.0
Make sure that the version of MSvbvm60.dll is 6.0.96.32 or later and that the file is dated June 21, 2002 or later. To do this, use either of the following methods:  Install Microsoft Windows 2000 Server Service Pack 4 (SP4).

For more information about how to locate Windows Server Service Pack 4, click the following article number to view the article in the Microsoft Knowledge Base:

260910 How to obtain the latest Windows 2000 service pack

 Update the Visual Basic runtime. To update the Visual Basic runtime, visit the following Microsoft Web site:

http://activex.microsoft.com/controls/vb6/vbrun60.cab



Note Alternatively, you can recompile the Visual Basic DLL with both the Retain in Memory property set to True and the Unattended Execution property set to True.

IIS 5.1
Make sure that the version of Msvbvm60.dll is 6.0.96.32 or later and that the file is dated June 21, 2002 or later. If you do not have this version or a later version of Msvbvm60.dll, you can update the Visual Basic runtime. To update the Visual Basic runtime, visit the following Microsoft Web site:

http://activex.microsoft.com/controls/vb6/vbrun60.cab

Note Alternatively, you can recompile the Visual Basic DLL with both the Retain in Memory property set to True and the Unattended Execution property set to True.

IIS 6.0
The server may be running in worker process isolation mode or in compatibility mode.

If the server is running in worker process isolation mode and if Service Pack 1 (SP1) is installed, no action is required. If SP1 is not installed, do either of the following:   Create a configuration file that is named W3wp.exe.cfg. Put this file in the following location:

%windir%\system32\inetsrv

The file must contain the following text: [Options] Unattended=1 Retained=1  Make sure that custom Visual Basic DLLs and third-party Visual Basic DLLs that are compiled with either the Retain in Memory property set to False or the Unattended Execution property set to False are recompiled with both the Retain in Memory property set to True and the Unattended Execution property set to True.</ul>

If the server is running in IIS 5.0 compatibility mode, you can follow the instructions for IIS 5.0. Note, however, that you cannot install Windows 2000 Server SP4 on Microsoft Windows Server 2003.

Alternatively, you can recompile the Visual Basic DLL with both the Retain in Memory property set to True and the Unattended Execution property set to True.

<div class="references_section">