ClrVersion Property

Applies to TestComplete 15.64, last modified on May 16, 2024

Description

Returns the .NET runtime version of the application domain.

Declaration

TestObj.ClrVersion

Read-Only Property String
TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section

Applies To

The property is applied to the following object:

View Mode

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

Property Value

A string holding the version number of .NET runtime in the "major.minor" format. For example, "2.0" or "4.0".

Example

The following example demonstrates how to determine which version of .NET runtime a .NET application targets:

JavaScript, JScript

function Test()
{
  var strVer = Sys.Process("Orders").AppDomain("Orders.exe").ClrVersion;
  Log.Message(strVer);
}

Python

def Test():
  strVer = Sys.Process("Orders").AppDomain("Orders.exe").ClrVersion
  Log.Message(strVer)

VBScript

Sub Test
  Dim strVer
  strVer = Sys.Process("Orders").AppDomain("Orders.exe").ClrVersion
  Log.Message strVer
End Sub

DelphiScript

procedure Test;
var strVer;
begin
  strVer := Sys.Process('Orders').AppDomain('Orders.exe').ClrVersion;
  Log.Message(strVer);
end;

C++Script, C#Script

function Test()
{
  var strVer = Sys["Process"]("Orders")["AppDomain"]("Orders.exe")["ClrVersion"];
  Log["Message"](strVer);
}

The following example shows how to determine the .NET runtime version of a specific object in a .NET application.

JavaScript, JScript

function Test()
{
  var obj = Sys.Process("Orders").WinFormsObject("MainForm");
  var strVer = obj.ClrAppDomain.ClrVersion;
  Log.Message(strVer);
}

Python

def Test():
  obj = Sys.Process("Orders").WinFormsObject("MainForm")
  strVer = obj.ClrAppDomain.ClrVersion
  Log.Message(strVer)

VBScript

Sub Test
  Dim obj, strVer
  Set obj = Sys.Process("Orders").WinFormsObject("MainForm")
  strVer = obj.ClrAppDomain.ClrVersion
  Log.Message strVer
End Sub

DelphiScript

procedure Test;
var obj, strVer;
begin
  obj := Sys.Process('Orders').WinFormsObject('MainForm');
  strVer := obj.ClrAppDomain.ClrVersion;
  Log.Message(strVer);
end;

C++Script, C#Script

function Test()
{
  var obj = Sys["Process"]("Orders")["WinFormsObject"]("MainForm");
  var strVer = obj["ClrAppDomain"]["ClrVersion"];
  Log["Message"](strVer);
}

See Also

AppDomain Object
ClrClassName Property
ClrFullClassName Property

Highlight search results