Microsoft KB Archive/812833

= FIX: You cannot run multiple processes of ASP.NET at the same time =

Article ID: 812833

Article Last Modified on 5/12/2007

-

APPLIES TO


 * Microsoft .NET Framework 1.1
 * Microsoft .NET Framework 1.0
 * Microsoft Visual Studio .NET 2002 Professional Edition
 * Microsoft Visual Studio .NET 2002 Enterprise Architect
 * Microsoft Visual Studio .NET 2002 Enterprise Developer
 * Microsoft ASP.NET 1.1
 * Microsoft ASP.NET 1.0

-



Note To correct this problem in the Microsoft .NET Framework version 1.1, you must apply the June 2003 ASP.NET hotfix rollup package. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

821156 ASP.NET 1.1 June 2003 hotfix rollup package





SYMPTOMS
On a computer that is running Microsoft Internet Information Services (IIS) 6.0 and Microsoft Windows Server 2003, you cannot run Microsoft ASP.NET 1.1 applications in isolation because IIS 6.0 uses application pools. Application pools can run applications in individual W3wp.exe processes. However, you cannot run Microsoft ASP.NET 1.0 or ASP.NET 1.1 applications in an isolated mode. Also, you cannot run multiple ASP.NET processes.

Note An ASP Web application that uses Microsoft Internet Information Services (IIS) 5.0 on Microsoft Windows 2000 or that uses IIS 5.1 on Microsoft Windows XP can be isolated to run in its own process space by setting the application protection to High (Isolated). You can configure this setting in the IIS (Inetmgr.exe) window. However, if you must use Microsoft ASP.NET application isolation or multiple processes, we recommend that you use Microsoft Windows Server 2003.



RESOLUTION
After you apply this software update, ASP.NET processes will run inside Dllhost.exe (COM+) processes.

Warning This change may cause unexpected behavior in some ASP.NET applications. For example, to use this software update, you must disable the  configuration element in the Machine.config file. When you do this, the attributes of the  configuration element, such as the memoryLimit attribute and the responseDeadlockInterval attribute, are ignored. Therefore, after you apply this software update, you will no longer be able to increase the value of the responseDeadlockInterval attribute to run long queries.

Software update information
A supported software update is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This software update may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Microsoft .NET Framework version 1.0 service pack that contains this software update.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the software update. For a complete list of Microsoft Product Support Services phone numbers and information about support costs, visit the following Microsoft Web site:

http://support.microsoft.com/default.aspx?scid=fh;[LN;CNTACTMS]

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
You must have the Framework 1.0 Service Pack 2 installed to apply this software update.

Restart requirement
If core Framework files are in use when you apply this software update, you may have to restart your computer after you apply this software update.

Software update replacement information
This software update does not replace any other software updates.

File information
The English version of this software update 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:32  1.0.3705.398    196,608  Aspnet_isapi.dll 01-May-2003 12:32                    4,169  Aspnet_perf.h   01-May-2003  12:32                   20,468  Aspnet_perf.ini 01-May-2003 12:32                   20,342  Aspnet_perf2.ini 01-May-2003 12:32  1.0.3705.398     24,576  Aspnet_regiis.exe 01-May-2003 12:32  1.0.3705.398     28,672  Aspnet_wp.exe 01-May-2003 12:32  1.0.3705.398     69,632  Corperfmonext.dll 01-May-2003 12:32  1.0.3705.398    303,104  Mscorjit.dll 01-May-2003 12:32  1.0.3705.398  1,953,792  Mscorlib.dll 01-May-2003 12:32                   10,284  Mscorlib.ldo 01-May-2003 12:32  1.0.3705.398  2,269,184  Mscorsvr.dll 01-May-2003 12:32  1.0.3705.398  2,269,184  Mscorwks.dll 01-May-2003 12:32                       15  Smartnav.htm 01-May-2003 12:32                    8,728  Smartnav.js   01-May-2003  12:32  1.0.3705.398  1,191,936  System.web.dll

Implementation information
After you apply this software update, you can run ASP.NET processes in high isolation. You can also run multiple ASP.NET processes.

To run ASP.NET processes in high isolation, follow these steps:   Start Notepad, and then paste the following sample code in a new text file. '' ' The InProcessIsapiApps.vbs modifies the IIS metabase property ' W3SVC\InProcessIsapiApps. It has three command-line options: ' ' GET - displays the modules in the InProcessIsapiApps list ' ADD - adds the specified ISAPI extension to the list ' REMOVE - removes the specified ISAPI extension from the list ''

action = &quot;NONE&quot; isapiFullPath = &quot;NONE&quot;

DetectExeType

ParseCommandLine

set w3svc = GetObject(&quot;IIS://localhost/w3svc&quot;) list = w3svc.GetEx(&quot;InProcessIsapiApps&quot;)

Select Case action Case &quot;GET&quot; ActionGet Case &quot;REMOVE&quot; ActionRemove Case &quot;ADD&quot; ActionAdd Case Else WScript.Echo(&quot;Unknown action&quot;) WScript.Quit(1) End Select

WScript.Quit(0)

' ' Sub ActionAdd

For Each isapi In list isapi = LCase(isapi) If (InStr(1, isapi, isapiFullPath, vbTextCompare) > 0) Then WScript.Echo(&quot;Error: &quot; & isapiFullPath & &quot; is already in the list!&quot;) WScript.Quit(1) End If Next

Dim count count = UBound(list) + 1

ReDim Preserve list(count) list(count) = isapiFullPath

w3svc.Put &quot;InProcessIsapiApps&quot;, (list) w3svc.SetInfo

WScript.Echo(&quot;Success: added &quot; & isapiFullPath)

End Sub

' ' Sub ActionGet WScript.Echo(vbCRLF & &quot;W3SVC/InProcessIsapiApps (&quot; & UBound(list)+1 & &quot; modules):&quot;) For Each isapi In list isapi = LCase(isapi) WScript.Echo(isapi) Next End Sub

' ' Sub ActionRemove

Dim matches matches = 0 For Each isapi In list isapi = LCase(isapi) If (InStr(1, isapi, isapiFullPath, vbTextCompare) > 0) Then matches = matches + 1 End if Next

Dim count count = UBound(list) + 1

Dim newList ReDim newList(count-matches-1)

Dim idx Dim found idx = 0 found = 0 For Each isapi In list isapi = LCase(isapi) If (InStr(1, isapi, isapiFullPath, vbTextCompare) = 0) Then newList(idx) = list(idx+found) idx = idx + 1 Else found = found + 1 End if Next

If found > 0 Then w3svc.Put &quot;InProcessIsapiApps&quot;, (newList) w3svc.SetInfo WScript.Echo(&quot;Success: removed &quot; & isapiFullPath) Else WScript.Echo(&quot;ERROR: &quot; & isapiFullPath & &quot; not found!&quot;) WScript.Quit(1) End If End Sub

  Sub DetectExeType Dim ScriptHost Dim ShellObject

Dim CurrentPathExt Dim EnvObject

Dim RegCScript Dim RegPopupType ' This is used to set the pop-up message box flags. ' I could not locate the pre-defined names RegPopupType = 32 + 4

On Error Resume Next

ScriptHost = WScript.FullName ScriptHost = Right(ScriptHost, Len(ScriptHost) - InStrRev(ScriptHost, &quot;\&quot;))

If (UCase(ScriptHost) = &quot;WSCRIPT.EXE&quot;) Then WScript.Echo (&quot;This script does not work with WScript.&quot;)

' Create a pop-up message box to prompt the user with the question &quot;Would you like to register CScript as your default host for VBscript?&quot; Set ShellObject = WScript.CreateObject(&quot;WScript.Shell&quot;) ' -1 is the time to wait. 0 means wait forever. RegCScript = ShellObject.PopUp(&quot;Would you like to register CScript as your default host for VBscript?&quot;, 0, &quot;Register CScript&quot;, RegPopupType) If (Err.Number <> 0) Then ReportError WScript.Echo &quot;To run this script by using CScript, type: &quot;&quot;CScript.exe &quot; & WScript.ScriptName & &quot;&quot;&quot;&quot; WScript.Quit (GENERAL_FAILURE) WScript.Quit (Err.Number) End If

' Determine if the user pressed yes or no. Yes is 6. No is 7. If (RegCScript = 6) Then ShellObject.RegWrite &quot;HKEY_CLASSES_ROOT\VBSFile\Shell\Open\Command\&quot;, &quot;%WINDIR%\System32\CScript.exe //nologo &quot;&quot;%1&quot;&quot; %*&quot;, &quot;REG_EXPAND_SZ&quot; ShellObject.RegWrite &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Classes\VBSFile\Shell\Open\Command\&quot;, &quot;%WINDIR%\System32\CScript.exe //nologo &quot;&quot;%1&quot;&quot; %*&quot;, &quot;REG_EXPAND_SZ&quot; ' Determine if the PATHEXT environment variable already exists. CurrentPathExt = ShellObject.RegRead(&quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PATHEXT&quot;) If Err.Number = &H80070002 Then Err.Clear Set EnvObject = ShellObject.Environment(&quot;PROCESS&quot;) CurrentPathExt = EnvObject.Item(&quot;PATHEXT&quot;) End If

ShellObject.RegWrite &quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PATHEXT&quot;, CurrentPathExt & &quot;;.VBS&quot;, &quot;REG_SZ&quot;

If (Err.Number <> 0) Then ReportError WScript.Echo &quot;Error Trying to write the registry settings!&quot; WScript.Quit (Err.Number) Else WScript.Echo &quot;Successfully registered CScript&quot; End If               Else WScript.Echo &quot;To run this script type: &quot;&quot;CScript.Exe adsutil.vbs &quot;&quot;&quot; End If

Dim ProcString Dim ArgIndex Dim ArgObj Dim Result

ProcString = &quot;Cscript //nologo &quot; & WScript.ScriptFullName

Set ArgObj = WScript.Arguments

For ArgIndex = 0 To ArgCount - 1 ProcString = ProcString & &quot; &quot; & Args(ArgIndex) Next

'Now, run the original executable under CScript.exe. Result = ShellObject.Run(ProcString, 0, True)

WScript.Quit (Result) End If

End Sub

' ' Sub ParseCommandLine If WScript.Arguments.Count = 0 Then Usage WScript.Quit(0) End if

If WScript.Arguments.Count = 1 And WScript.Arguments(0) = &quot;GET&quot; Then action = &quot;GET&quot; ElseIf WScript.Arguments.Count = 2 And WScript.Arguments(0) = &quot;REMOVE&quot; Then action = &quot;REMOVE&quot; isapiFullPath = LCase(WScript.Arguments(1)) ElseIf WScript.Arguments.Count = 2 And WScript.Arguments(0) = &quot;ADD&quot; Then action = &quot;ADD&quot; isapiFullPath = LCase(WScript.Arguments(1)) Else Usage WScript.Quit(1) End If End Sub

' ' Sub Usage WScript.Echo WScript.Echo(&quot;Usage:&quot;) WScript.Echo(&quot; cscript.exe &quot; & WScript.ScriptName & &quot; GET&quot;) WScript.Echo(&quot; cscript.exe &quot; & WScript.ScriptName & &quot; REMOVE &quot;) WScript.Echo(&quot; cscript.exe &quot; & WScript.ScriptName & &quot; ADD &quot;) WScript.Echo WScript.Echo(&quot;Example:&quot;) WScript.Echo(&quot; cscript.exe &quot; & WScript.ScriptName & &quot; REMOVE C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322&quot;) End Sub  Save the sample code as a script file. Name the script file InProcessIsapiApps.vbs. In the last line of the script file, make sure that path of the .NET Framework is valid for your computer and for your version of the Framework. In your Machine.config file, set enable=false in the <processModel> configuration element, and then save the file.</li> Run the script by using the GET parameter. To do this, click Start, click Run, type nProcessIsapiApps.vbs GET, and then press ENTER.

Note You may receive a message to update your computer to the CScript Windows Script Host.</li> In the script output, note the path of the Aspnet_asipi.dll file.</li> Run the script again to remove the Aspnet_asipi.dll file. To do this, use the REMOVE parameter and the path of the .NET Framework that is valid for your computer. For example, run the following command:

nProcessIsapiApps.vbs REMOVE C:\WINNT\Microsoft.NET\Framework\v1.0.3705\aspnet_isapi.dll

</li> Give the IWAM_MACHINENAME account the same permissions as ASP.NET. For more information about ASP.NET configuration requirements, click the following article number to view the article in the Microsoft Knowledge Base:

307626 ASP.NET configuration overview

</li> In the IIS window (Inetmgr.exe), set the application virtual directory to run in High isolation.</li> At a command prompt, run IISRESET.</li></ol>

<div class="status_section">

STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.

<div class="moreinformation_section">

MORE INFORMATION
For more information, click the following article number to view the article in the Microsoft Knowledge Base:

824684 Description of the standard terminology that is used to describe Microsoft software updates

This software update also contains a secondary fix for the .NET Framework 1.0 that lets you unload the application domain. The fix adds the UnloadAppDomain method to the HttpRuntime class. For example, you can use the HttpRuntime.UnloadAppDomain method. This method quits the current application. The application restarts the next time that a request for it is received.

<div class="references_section">