Microsoft KB Archive/255769

= PRB: ASP 0197 When You Store STA or Both-Model Objects in Application =

Article ID: 255769

Article Last Modified on 11/15/2006

-

APPLIES TO


 * Microsoft Active Server Pages 4.0

-



This article was previously published under Q255769



SYMPTOMS
When you run an Active Server Pages (ASP) page, the following error message appears:

Application object, ASP 0197 (0x80004005)

Cannot add object with apartment model behavior to the application intrinsic object.



CAUSE
Either the ASP code tried to store a single-threaded apartment (STA) COM object or a both-modeled COM object that does not support the free-threaded marshaler (FTM) in application scope.



RESOLUTION
To resolve this problem, design components marked both that aggregate the FTM if stored in application scope. Do not store STA objects in application scope or session scope.



STATUS
This behavior is by design. Objects stored in either session or application scope are going to be in a different COM apartment. For their interfaces to be used at page scope, these must be marshaled. However there is no support for marshaling the ASP built-in objects.

