7

After updating to Windows 11 on June 2, 2025, I'm experiencing major issues with legacy Classic ASP applications on IIS that make use of both VBScript and JScript on the server side.

json library

Error Details:

Pages that previously ran for years without issue now randomly throw the following error:

Active Server Pages error 'ASP 0240' Script Engine Exception

A ScriptEngine threw exception 'C0000005' in 'IActiveScript::SetScriptState()' from 'CActiveScriptEngine::ReuseEngine()'.

In the Windows Application event log, I see messages like:

Eccezione del modulo di script 'C0000005' in 'IActiveScript::SetScriptState()' da 'CActiveScriptEngine::ReuseEngine()'

This causes the application to throw a HTTP 1.1/500 Internal Server Error for many requests. Sometimes the page loads, but more often it fails, seemingly at random. Technical Background:

Environment: IIS 10 / Classic ASP / Windows 11
Scripting: Many of my ASP pages combine <% ... %> blocks (VBScript) with ... sections.

I rely on JScript for things like JSON parsing (Douglas Crockford’s json2.js ported to ASP), string manipulation, and various helper functions, while using VBScript for main business logic.

This hybrid approach worked flawlessly on all prior versions of Windows/IIS.

What I’ve Tried / Current Workaround:

Through community forums, I found that enabling "Execute In MTA" (COM+ Properties > ASP > "Execute In MTA" = True) in IIS seems to temporarily avoid the crash.

This does appear to stop the immediate crash, but introduces other side effects, including session/thread safety problems and instability with certain legacy COM objects.

Disabling JScript or rewriting all JScript as VBScript is not feasible due to project complexity and size.

Key Observations:

This appears to be a regression or breaking change in Windows 11 , as the exact same codebase worked perfectly on all earlier Windows 10 and Windows Server 2019/2022 builds.

Classic ASP with mixed VBScript and JScript is now fundamentally unstable: JScript code can no longer be reliably executed within VBScript pages.

Many open source JSON solutions and advanced Classic ASP modules rely on this hybrid script model.

It looks like the underlying scripting engine has changed, with resource management (IActiveScript::SetScriptState / ReuseEngine) now failing when both engines are loaded.

Has anyone found a permanent workaround or patch from Microsoft for this issue?

Is there a way to continue using both JScript and VBScript together in Classic ASP, or is this now a dead end on current Windows releases?

Has Microsoft acknowledged this as a bug or given any indication that a fix will be released?

Why This Is Important:

There are thousands of business-critical, long-running Classic ASP apps that depend on this scripting combination (especially for JSON parsing).

Breaking this compatibility without warning or providing migration tooling is a major blocker for companies unable to rewrite entire applications in the short term.

"Execute In MTA" is a dangerous workaround, as it introduces potential concurrency and state issues in applications never designed for multi-threaded execution.

I tried uninstalling both KB5054979 and KB5058499 updates (as seen in the update history), but this did not resolve the issue. Previously, I was able to use a system restore point from 2025-06-01 to roll back changes, but now I can't even find the system restore interface anymore.

7
  • The closest I found to this issue is on the Microsoft Answers Forum - With 24H2 on W11 Pro IIS with ASP Classic using JScript return "random" the error 500. Commented Jun 3 at 16:13
  • Seems like this has been reported before but no answer was given - Classic ASP JScript Broken after Windows 11 24H2 Commented Jun 3 at 16:15
  • It's likely to do with how the code isolation works and you may need to adjust the application pool to counteract it. This is purely guess work though. Commented Jun 3 at 16:16
  • Also, why do you have "thousands of business-critical, long-running Classic ASP apps that depend on this scripting combination (especially for JSON parsing)." running on Windows 11? Commented Jun 3 at 16:19
  • We've been running a legacy Classic ASP app (with JScript/JSON parsing) on Windows 11 without issues for years. Suddenly after the 02.06.2025 update, we started getting C0000005 ScriptEngine errors. Rolling back updates didn’t help. This is a critical app—rewriting isn’t feasible. Is there any official fix or workaround? Commented Jun 3 at 17:29

1 Answer 1

12

We found, due to the Windows 11 24H2, jscript9legacy.dll was getting used instead of jscript.dll (per this reference: Script errors in Working Papers Caseview - Windows 24H2 Update). According to Caseview, "Windows 11 24H2 has begun setting a local policy that, by default, causes applications to use the jscript9legacy.dll instead of jscript.dll. jscript9legacy.dll does not contain the full functionality" as jscript.dll.

To use jscript.dll instead of jscript9legacy.dll, we have two methods:

  1. Generate Registry Keys and Value via .REG file

    1. Open Notepad

    2. Insert the following text:

      Windows Registry Editor Version 5.00
      
      [HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Internet Explorer\Main]
      
      "JScriptReplacement"=dword:00000000
      
    3. Save as a .REG file.

    4. Execute the file by double clicking.

  2. Manually generate the Registry Keys and Values via Registry Editor

    1. Launch regedit.

    2. Navigate to: HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Main (Keys Internet Explorer and Main may need to be created)

    3. Right-click the Main key and select New | DWORD (32-bit) Value.

    4. Name the new value JScriptReplacement.

    5. Set the value of JScriptReplacement to 0.

Users can directly modify the registry key in either HKEY_LOCAL_MACHINE (as shown above) or HKEY_CURRENT_USER.

Now when we call a Server Side JavaScript function, it no longer produces an error.

Sign up to request clarification or add additional context in comments.

6 Comments

I didn't know this, great info. Thanks for sharing.
Thank you so much for this post. I've been encountering these random Script Engine Exception errors and it's been driving me nuts. I've googled this error off and on over the past month to no avail. I created the .reg file in the post and rebooted. No more errors on my classic .asp pages!
This is the perfect solution! My Application crashed sporadically because of the JScript issue! Now everything is up and running flawless! Thank you so much!
Thanks for sharing this. Just to add: we started seeing the same VBScript/JScript mixing errors on Windows Server 2025, and applying your registry change fixed it for us too. Much appreciated!
Confirmed this fix works on Win11 25H2, too. Thank you so much!
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.