FIX: DLLHOST Process Ends When Transacted WSC Components Are Called from IIS

This article was previously published under Q275293
This article has been archived. It is offered "as is" and will no longer be updated.
When you use Microsoft JScript to write Windows Script Components (WSC) and launch them from an Active Server Pages (ASP) page that is written in JScript, the DLLHOST process is terminated if the component throws an error on a Microsoft Windows 2000-based computer.

NOTE: This problem does not occur with script components that are written in other languages such as Microsoft Visual Basic Scripting Edition (VBScript), Microsoft Visual Basic, or Microsoft Visual C++, even though they have code that is similar to the JScript component and throw a similar error. Also, this problem does not occur if you change the scripting language from JScript to VBScript, either in the ASP page or in the component.
To resolve this problem, obtain the latest service pack for Windows 2000. For additional information, click the following article number to view the article in theMicrosoft Knowledge Base:
260910 How to Obtain the Latest Windows 2000 Service Pack

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Windows 2000 Service Pack 2.

Steps to Reproduce Behavior

  1. In Notepad, create a new text file named JTest.wsc, and then paste the following code:
    <?xml version="1.0"?><component><?component error="1" debug="1"?><registration	description="JScript Test WSC"	progid="JTest.obj_WSC"	version="1.00"	classid="{2EE86C35-1A90-4D93-AE5B-C3BB494AD228}"></registration><public>	<method name="DisableCommit"></method>	<method name="EnableCommit"></method>	<method name="IsInTransaction"></method>	<method name="SetAbort"></method>	<method name="SetComplete"></method></public><script language="JScript">< ![CDATA[var __THIS_MODULE__ = "JTest.obj_WSC";var undefined;var ut_oc  = undefined;try{    if(ut_oc == undefined)        ut_oc = new ActiveXObject("MTxAS.AppServer.1").GetObjectContext();}catch(e){    throw e;}// Public Functionsfunction DisableCommit(){    ut_oc.DisableCommit();}function EnableCommit(){    ut_oc.EnableCommit();}function IsInTransaction(){    ut_oc.IsInTransaction();}function SetAbort(){    ut_oc.SetAbort();}function SetComplete(){    ut_oc.SetComplete();}]] ></script></component>						
  2. In Notepad, create a new text file named TestWsc.asp, and then paste the following code:
    <%@ Transaction="Required" Language="JScript" %><% Response.Buffer = false; %><html>  <head><%  function VerboseCreate(sProgID)  {    var oObject;    Response.Write (sProgID + "...");    oObject = Server.CreateObject (sProgID);    Response.Write ("Pass<br>");    return (oObject);  }  function InstantiateObjects()  {    try{      var oTestXact1 = VerboseCreate("JTest.obj_WSC");      var oTestXact2 = VerboseCreate("JTest.obj_WSC");      oTestXact1.SetAbort();      oTestXact2.SetComplete();      oTestXact1 = null;      oTestXact2 = null;    }    catch(e){      Response.Write("<b>" + "FAILED: Exception: [" + e.number + "] " + e.description + "<br>" + "</b>");    }  }%>  </head>  <body>    <table border="1">      <tr>        <th>Operation</th>        <th>Result</th>      </tr>      <tr>        <td>Instantiate Objects</td>        <td><% InstantiateObjects(); %></td>      </tr>    </table>  </body></html>						
  3. On the Start menu, point to Programs, point to Administrative Tools, and click Internet Information Services.
  4. Right-click Default Website, and then click Properties.
  5. On the Home directory tab, in the Application Protection drop-down list box, click High (Isolated), and then click OK. With high protection, each component is executed inside a separate DLLHOST.
  6. Right-click JTest.wsc, and then click Register to register the component.
  7. Move TestWsc.asp to your default Web site's home directory, which is C:\Inetpub\Wwwroot by default.
  8. Open Microsoft Internet Explorer, and type http://localhost/TestWsc.asp in the address bar. Internet Explorer endlessly loads the page with Exception: [-2147164157].
  9. In Task Manager, check the processes. The DLLHOST process to surrogate JScript.wsc does not appear.

Article ID: 275293 - Last Review: 02/28/2014 04:21:48 - Revision: 2.1

  • Microsoft COM+ 1.0
  • kbnosurvey kbarchive kbbug kbcomplus kberrmsg kberror kbfix kbgrpdsvc kbiss kbwin2000presp2fix KB275293