dictionary object & iis5 errors

Results 1 to 3 of 3

Thread: dictionary object & iis5 errors

  1. #1
    mike e. Guest

    Default dictionary object & iis5 errors

    I&#039ve been trying to take a web application developed with ASP on IIS4 (where it runs without errors) and get it running on a Windows2000 Professional machine with IIS5. I keep getting the following error:<BR><BR>Application object error &#039ASP 0197 : 80004005&#039 <BR><BR>Disallowed object use <BR><BR>//global.asa, line 101<BR><BR>Cannot add object with apartment model behavior to the application intrinsic object. <BR><BR>----------------------------------------------------------------<BR><BR>The line that produces the error is as follows:<BR><BR>Set Application("Users") = Server.CreateObject("Scripting.Dictionary")<BR><BR >----------------------------------------------------------------<BR>When I looked up the error in the Microsoft Knowledge base it offered the following explanation:<BR>CAUSE<BR>The Dictionary object&#039s 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." <BR><BR>RESOLUTION<BR>To work around this problem, create all global Scripting.Dictionary objects with a session scope as follows: <BR><BR> &#060;%Set Session("SD")= Server.CreateObject("Scripting.Dictionary")%&#062; <BR><BR>STATUS<BR>This behavior is by design. <BR><BR>REFERENCES<BR>Please refer to the following Windows NT 4.0 Option Pack Product Documentation for Scope and Threading guidelines...<BR>----------------------------------------------------------------<BR>Their suggested resolution is not practical; I need to use the dictionary object at the application level, not session. Furthermore, when I read through the NT4 optionpack release notes, they indicated:<BR><BR>The Scripting.Dictionary object is erroneously marked as Both-threaded. It should be marked as Apartment-threaded. To change this, use the Registry Editor to open the following registry key:<BR>HKEY_CLASSES_ROOT<BR> CLSID<BR> {EE09B103-97E0-11CF-978F-00A02463E06F}<BR> InprocServer32<BR><BR>Change the named value for ThreadingModel to Apartment. If you use the Dictionary object at Application scope without making this change, corruption of data may occur.<BR><BR>----------------------------------------------------------------<BR>However, the value was already set to "Apartment."<BR>I&#039m at a loss--please advise.<BR><BR>

  2. #2
    tmetzler Guest

    Default Check this replacement out.

    These guys have a replacement dictionary object:<BR>http://www.caprockconsulting.com/comsoftware.asp<BR><BR>Fully multithreaded and free. I&#039ve been using it in the iis application on my sites for awhile.<BR><BR><BR><BR>

  3. #3
    mike e. Guest

    Default RE: Check this replacement out.

    Metzler, you just saved me a whole lot of work from code rewriting--the caprock dictionary works great--very slick!<BR>I&#039m in debt, thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts