AppDomain Method

Applies to TestComplete 15.47, last modified on January 20, 2023

Description

This method returns the AppDomain object that is a wrapper for the AppDomain object of .NET Framework. You can use this object to retrieve information about application domains existing in the ProcessObj process and to get access to static non-visual objects that exist in that domain (you can get the access through the dotNET property).

There are two implementations of this method:

Declaration

TestObj.AppDomain(Name)

TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section
Name [in]    Required    String    
Result An AppDomain object

TestObj.AppDomain(Name, ClrVersion)

TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section
Name [in]    Required    String    
ClrVersion [in]    Required    String    
Result An AppDomain object

Applies To

The method is applied to the following object:

View Mode

To view this method in the Object Browser panel and in other panels and dialogs, activate the Advanced view mode.

Parameters

The method has the following parameters:

Name

The friendly name of the application domain. This name is specified by the domain’s native FriendlyName property value.

The friendly name of the default application domain is the same as the file name of the application executable. For example, if the application file name is Orders.exe, the friendly name of its default domain is "Orders.exe".

Note that a process can have multiple application domains with different names.

ClrVersion

This parameter is only used if the application hosts multiple CLR versions in the same process, for example, .NET 4.0 runtime and .NET 2.0 runtime. It specifies the CLR version of the application domain that you wish to obtain. The version number string must have the "major_version.minor_version" format. For example, "4.0" or "2.0".

Result Value

An AppDomain object that provides scripting access to the specified application domain.

This object is a wrapper over the .NET Framework AppDomain object. For more information about the object and its properties and methods, see the AppDomain Class article in the MSDN library.

Remarks

The Process.AppDomain method is available only if the .NET Application Support plugin is installed and enabled in File | Install Extensions.

Example

For examples of using the AppDomain object in tests, see the following topics:

See Also

AppDomain Object
dotNET Property
WaitAppDomain Method
Testing .NET Applications
Accessing Native Properties and Methods of .NET Objects
Accessing Non-Visual Objects in .NET Applications
Creating Instances of .NET Classes Defined in Applications

Highlight search results