How to Debug the Scriptor Component
To debug a Scriptor component (Progid = Commerce.Scriptor), you need to register it as a COM+ application, and you must enable the Microsoft Windows Just-In-Time (JIT) script debugging key in the registry.
Use one of the following two methods for debugging Scriptor pipeline components:
Use this method if you are logged on to the console of the server when the pipeline is executing:
Register the component as a COM+ server application (out-of-process).
Alter the registration of the Scriptor component so that it is not pooled by COM+ object pooling.
Enable Just-In-Time (JIT) debugging.
Restart Internet Information Services (IIS) by using the IISReset command.
Use this method if you are logged on to the server remotely using Terminal Services:
If the IIS anonymous identity is an account that can be logged on interactively, then log on using the account and set the following registry key:
HKEY_CURRENT_USER\Software\Microsoft\Windows Script\Settings\JITDebug = 1
Otherwise, set the following registry key:
HKEY_USERS\.DEFAULT\Software\Microsoft\Windows Script\Settings\JITDebug = 1
Set the application to run in low process isolation (do not use medium isolation).
Restart IIS by using the IISReset command.
For information about where the JITDebug registry value is located in different configurations, see https://go.microsoft.com/fwlink/?LinkId=15098.
After using the following procedures to perform the preparatory steps outlined for the appropriate method, use your favorite script debugger such as Visual Studio 2008 to debug the Scriptor component. For example, add a stop statement in your script file to launch your default script debugger.
To register the Scriptor component as a COM+ server application (out-of-process)
Click Start, point to Programs, point to Administrative Tools, and then click Component Services.
Expand Component Services, expand Computers, and then expand My Computer.
Right-click the COM+ Applications folder, point to New, and then click Application. The COM+ Application Install Wizard appears.
Click Next, and then click Create an empty application.
Type a name for the new application, for example, Commerce Scriptor Application.
Select Server Application, and then click Next.
In the Set Application Identity dialog box, accept the default setting (interactive user) if the IIS anonymous identity is an account that can be logged on interactively. Otherwise, select the appropriate user.
Click Next, and then click Finish.
Note
If your server is running Microsoft Windows Server 2003, you must click Next twice to complete two additional steps: one step to create user roles and another step to add users to those roles.
Note
The COM+ application is configured with security enabled by default. This causes an "Access Denied" error when a pipeline containing a Scriptor component is executed. You need to perform the following procedure to disable security checks on the COM+ application.
To disable security checks on the COM+ application
Click Start, point to Programs, point to Administrative Tools, and then click Component Services.
Expand Component Services, expand Computers, expand My Computer, and then expand COM+ Applications.
Right-click the System Application node, and then click Properties.
On the Security tab, clear the Enforce access checks for this application check box.
Click OK to apply the change.
To alter the registration of the Scriptor component so that it is not pooled by COM+ object pooling
Find the following key in the registry:
HKLM\Software\Classes\CLSID\{D48BE490-59E6-11D0-82CA-00C04FD658E9}\ImplementedCategories
Remove the following subkey:
{4CB33C86-58FA-4E10-97A8-F19AFF3B81D9}
Important Note: Performing these steps makes the component nonpoolable. Remember to reset the same key when you finish debugging or performance will suffer.
To import the Scriptor component into the newly created application
Click Start, point to Programs, point to Administrative Tools, and then click Component Services.
Expand Component Services, expand My Computer, and then expand COM+ Applications.
Right-click the Components folder, click New, and then click Component. The COM Component Install Wizard appears.
Click Next, and then click Import component(s) that are already registered.
Click the Choose Components to Import tab, and select Commerce.Scriptor.1.
Click Next, and then click Finish. The Commerce.Scriptor.1 component appears under the Components subkey.
To enable the JIT debugging registry key
If the IIS anonymous identity is an account that can be logged on interactively, then log on using the account and set the following registry key:
In the registry, go to the location:
HKEY_CURRENT_USER\Software\Microsoft\Windows Script\Settings
Add the DWORD value "JITDebug" = 1. If the DWORD value is already there, go to the next step.
Set the key to 1 as follows:HKEY_CURRENT_USER\Software\Microsoft\Windows Script\Settings\JITDebug = 1
If the account cannot be logged on interactively, set the following value to 1:
HKEY_USERS\.DEFAULT\Software\Microsoft\Windows Script\Settings\JITDebug = 1
Warning
Do not leave JIT debugging enabled on production servers that run unattended in a data center. When you enable JIT debugging, any script run-time or compile error that occurs in a Windows Script Host (WSH) script (such as the Commerce.Scriptor component) causes the server execution to stop until you dismiss the JITDebug dialog box on the server console.
Set the application to run in low process isolation.
Note
This step only applies to classic Active Server Pages (ASP) applications running on IIS 5.0 or IIS 6.0 in IIS 5.0 isolation mode. If you are running ASP.NET or are using IIS 6.0 in native mode, the Scriptor component will be running in the Aspnet_wp.exe or W3wp.exe process.
Restart IIS by using the IISReset command.
Note
The IISReset command is needed if you are using pooled pipelines because the pooled pipeline object caches the Scriptor component. The Scriptor component in turn caches the script engine and the script, and the script engine has already read and cached the registry key value. IISReset forces the pool to be loaded and then unloaded again.