Microsoft KB Archive/194397

= Err Msg: Application Object Error 'ASP 0197 : 80004005' Disallowed Object Use =

Article ID: 194397

Article Last Modified on 6/22/2005

-

APPLIES TO


 * Microsoft Internet Information Server 4.0

-



This article was previously published under Q194397



We strongly recommend that all users upgrade to Microsoft Internet Information Services (IIS) version 6.0 running on Microsoft Windows Server 2003. IIS 6.0 significantly increases Web infrastructure security. For more information about IIS security-related topics, visit the following Microsoft Web site:

http://www.microsoft.com/technet/security/prodtech/IIS.mspx



SYMPTOMS
When you try to use an application variable to create an application-level object of MSWC.BrowserType, the following error is returned:

Application object error 'ASP 0197 : 80004005'

Disallowed object use

/ / .asp, line 

Cannot add object with apartment model behavior to the application

intrinsic object



CAUSE
This error occurs because the MSWC.BrowserType object is set for apartment threading, which is not allowed for application-level objects.

This behavior is by design.

In actual practice, it is a bad idea to create an application-level variable for the MSWC.BrowserType object because this object is shared by all sessions, and each session may be using a separate browser.



WORKAROUND
To work around this problem, create all global MSWC.BrowserType objects with a session scope as follows:

<%Set Session("BT")= Server.CreateObject("MSWC.BrowserType")%>

Keywords: kbbug kbpending KB194397

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.