Microsoft KB Archive/194803

= PRB: Scripting.Dictionary Object Fails in ASP Application Scope =

Article ID: 194803

Article Last Modified on 4/25/2001

-

APPLIES TO


 * Microsoft Visual InterDev 6.0 Standard Edition

-



This article was previously published under Q194803



SYMPTOMS
When storing the Scripting.Dictionary object in an Application variable the following error occurs:

Application object error 'ASP 0197 : 80004005'

Disallowed object use /xxx.asp, line 2. Cannot add object with apartment model behavior to the application intrinsic object.



CAUSE
The Dictionary object's threading model is incorrectly set to "Both" in the registry when Internet Information Server (IIS) 4.0 is initially installed. This is documented in the IIS documentation, which also includes instructions to update the ThreadingModel registry key. When Visual Studio 6.0 is installed it updates/corrects the threading model of the Dictionary object, setting it to "Apartment."



RESOLUTION
To work around this problem, create all global Scripting.Dictionary objects with a session scope as follows:

  <%Set Session("SD")= Server.CreateObject("Scripting.Dictionary")%>



STATUS
This behavior is by design.

