Acquire Image Tool Properties Remoting, Object Scope, and Serialization When an object is created, it is always created within the scope of the application domain in which it was created. If, for example, you are creating an object that derives from RemotableObject , it will be owned by the current application domain. If your intention is to create an object and used it in the AceServer application domain, you must use the AceServer::CreateObject method to create the object. This method will force the object to be created in the AceServer application domain.
This is important because there are limitations imposed by the .NET framework when saving information that crosses an application domain boundary. Using the AceServer::CreateObject method will ensure all objects existing in the application domain of the AceServer and that there are no access or serialization issues if the data is saved as part of the workspace. Here is an example showing a C# script creating an object that is saved as part of the workspace incorrectly: The correct way to create remotable objects that cross the application domain boundary would be:
This special handling of object creation is not required for value types, objects that will not cross the application domain boundary. or objects that are not saved as part of the workspace. ACE Reference Guide, 18317-000 Rev A Page 626