PRB: Scripting.Dictionary Object Fails in ASP Application ScopeID: Q194803
|
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.
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."
To work around this problem, create all global Scripting.Dictionary objects
with a session scope as follows:
<%Set Session("SD")= Server.CreateObject("Scripting.Dictionary")%>
This behavior is by design.
Please refer to the following Windows NT 4.0 Option Pack Product
Documentation for Scope and Threading guidelines:
Microsoft Internet Information Server
Programmers Reference
Creating Components for ASP
Planning for Component Development
Component Design Guidelines
Internet Information Server Version 4.0 Release Notes
Keywords : kbASPObj kbVisID600 kbGrpASP
Version : WINDOWS:6.0
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: May 4, 1999