Module Tab - Edit .NET Call Dialog Box
- Mise à jour2025-07-21
- Temps de lecture : 7 minute(s)
Module Tab - Edit .NET Call Dialog Box
Module Tab
The Module tab contains the following options:
-
Assembly
—The absolute or relative file path of the assembly the step calls. Relative pathnames are relative to the TestStand search directory paths. Use the
Edit Search Directories
dialog box to
customize the search directory paths
.
-
Browse for Assembly
—Launches a Browse dialog box in which you can specify a pathname for the assembly.
Note
-
Starting with TestStand 2024 Q4, browsing the Global Assembly Cache (GAC) is no longer supported.
- Calling C++/CLI assemblies from a .NET step is no longer supported.
-
-
Browse for Assembly
—Launches a Browse dialog box in which you can specify a pathname for the assembly.
- Advanced Settings —Launches the Advanced Settings window, in you can control the lifetime of an object the .NET step creates.
- Reload Assemblies and Prototypes —The .NET Adapter reloads the information about classes, methods, and properties in the assembly for each specified call and updates the prototype specified for the calls, if needed.
- Root Class —The name of the class on which the first call in a chain of calls for the step operates. When you select an assembly, the .NET Adapter populates this control with a list of classes defined for the assembly.
-
Edit Code
—Launches Microsoft Visual Studio to edit the code associated with the call currently selected in the .NET Invocation control. If you have not specified a project or source file on the
Source Code
tab, TestStand launches an Open File dialog box and prompts you to browse for the files. Because you can specify Edit Code operations for multiple calls in a single step, the project file you select applies to any other calls you make in the same step, but you must specify a new source file for each individual call.
Note You must have a supported version of Visual Studio installed and a valid call currently selected in the .NET Invocation control to use the Edit Code button.
-
Create Code
—Launches Visual Studio to create a shell function by using the member name of the call currently selected in the .NET Invocation control as the name of the method to create and the class name of the call as the class in which to create the function. If you have not specified a project or source file on the Source Code tab, TestStand launches an Open File dialog box and prompts you to browse for the files. Because you can specify Create Code operations for multiple calls in a single step, the project file you select applies to any other calls you make in the same step, but you must specify a new source file for each individual call.
Note You must have a supported version of Visual Studio installed and a call with a valid class name currently selected in the .NET Invocation control to use the Create Code button.The .NET Adapter appends the newly created function to the end of the source file you select on the Source Code tab. If a code template file exists for the step type you use for the step, the adapter uses the template to create the shell for the new function. If the project file you specify on the Source Code tab is not in the Visual Studio solution, the adapter prompts you to add it. If the source file you specify on the Source Code tab is not in the project, the adapter prompts you to add it. If you already have the source code for the function, click the Edit Code button instead to edit the code associated with the call currently selected in the .NET Invocation control. If template source code exists for the step type you use for the step, the .NET Adapter inserts the parameter information from the template source code into the new function shell. If the step type does not have a code template, TestStand uses the default template for the adapter. When the .NET Adapter creates the code, the adapter launches a copy of Visual Studio and displays the file in Visual Studio.
-
.NET Invocation
—The chain of calls the step completes at run time. Right-click, double-click, or press <Ctrl-Space> to show the list of members available to call. Select a member name in the list of members or type the member name to specify it. Press <Enter> or <Tab> to insert the call currently selected in the member list into the .NET Invocation control. Enter a period (
.
) character or click the <Click here to add a call> text to show a list of members available for the next call.
After you specify the calls, the .NET Invocation control shows the signature of the call. TestStand shows calls you incorrectly or partially specify in red. Parameters that contain invalid values or required parameters that you have not yet specified display in red even if the call is valid.
Click anywhere on the call signature to select the call and view or edit its parameters in the Parameters Table. TestStand shows the currently selected call in bold in the .NET Invocation control. Click anywhere on a particular parameter in the signature to highlight the parameter in the Parameters Table. TestStand shows the selected parameter in bold in the .NET Invocation control.
For the first call in the chain you specify in the .NET Invocation control, the member shows only constructors, static members, and the following special case types:
-
Use Existing Object
—Use this call type to specify an existing object to use instead of calling a constructor. The Parameters Table for this call contains an
Existing Object
parameter for you to specify, and this parameter must contain the value of a valid object reference—or basic type in the case of the
System.String
class or other similar basic classes—that refers to the object on which to perform the next call. If you specify a struct—which is a value type—and not a class—which is a reference type—for the root class of the step, you can also specify a variable or property of a named data type that corresponds to the struct. Click the
Create Type from Struct
button to launch the
Create Custom Data Type from Struct
dialog box and create a named data type. If you specify an instance of a named data type, the .NET Adapter creates a temporary .NET struct and copies the corresponding fields between the struct and the TestStand variable.
Note
Starting with TestStand 2024 Q4, 'Create Remote Object' is no longer supported.
-
Use Existing Object
—Use this call type to specify an existing object to use instead of calling a constructor. The Parameters Table for this call contains an
Existing Object
parameter for you to specify, and this parameter must contain the value of a valid object reference—or basic type in the case of the
System.String
class or other similar basic classes—that refers to the object on which to perform the next call. If you specify a struct—which is a value type—and not a class—which is a reference type—for the root class of the step, you can also specify a variable or property of a named data type that corresponds to the struct. Click the
Create Type from Struct
button to launch the
Create Custom Data Type from Struct
dialog box and create a named data type. If you specify an instance of a named data type, the .NET Adapter creates a temporary .NET struct and copies the corresponding fields between the struct and the TestStand variable.
-
Parameters Table
—Contains the parameters and return values for all calls in the step. The Parameters Table lists parameters for each call under a row that displays the member name for the call. The Parameters Table contains the following columns:
-
Parameter Name
—The name of the parameter. For properties and fields, the first call the Parameter Name column contains a combo box you can use to switch between Get Property and Set Property. If a public version of a Get or Set does not exist for the property or field, the combo box does not include the option.
Note Parameters with attributes include an Edit Attributes button in the Name column of the Parameters Table. You can edit attributes for fields of structs and elements of arrays. TestStand associates parameter attributes with the module parameter, which TestStand stores with the step configuration information and not with the parameter value that TestStand passes to the module. Right-click an item in the Parameters Table to and select Edit Attributes from the Parameters Table context menu to launch the Attributes dialog box.
-
Type
—.NET data type for the parameter.
For one-dimensional arrays, you can specify an expression value for the entire array, or you can specify values for each element of the array. Use the plus (
+
) buttons to insert a new element in the array, and the minus (
-
) buttons to remove specific elements from the array.
- Create Type from Struct —If the data type is a struct, such as a .NET value type, this button appears in the cell and launches the Create Custom Data Type from Struct dialog box, in which you can configure a new custom data type to use as the variable type for passing the struct parameter.
- In/Out —Indicates whether the parameter is an input, output, or both.
- Log —When you enable this option, the step logs the parameter as an additional result. Enabling this option is equivalent to using the checkbox next to the additional result name in the Additional Results dialog box. For in/out parameters, enabling this option enables the [In] parameter and the [Out] parameter in the Additional Results dialog box. This option is indeterminate for in/out parameters if you specify to log only the [In] parameter value or only the [Out] parameter value. If this option is indeterminate, a tooltip specifies whether the Additional Results dialog box specifies to log the [In] parameter value or the [Out] parameter value.
- Dispose —When you enable this option, TestStand calls the Dispose method on the .NET object when the output parameter references are released. If the object does not implement the IDisposable interface, this option is ignored.
- Use Default Value —When you enable this option, TestStand uses the default value of the parameter. An option appears in this column only for parameters that have default values.
- Value —A TestStand expression. For input parameters, TestStand passes the value of this expression. For output parameters, TestStand stores the data the method returns in the location this expression specifies. To help you enter an expression in the Value column, click the Expression Browse button to launch the Expression Browser dialog box. For enumerated types, a combo box displays all valid values for the type. You can also use an expression for an enumerated type. Refer to the .NET Call Parameters topic for more information about using enumeration parameters.In addition, you can store all .NET types directly in a TestStand object reference variable, which is useful when you want to store a .NET array without making a copy and do not need to access the array directly from TestStand.
-
Parameter Name
—The name of the parameter. For properties and fields, the first call the Parameter Name column contains a combo box you can use to switch between Get Property and Set Property. If a public version of a Get or Set does not exist for the property or field, the combo box does not include the option.
See Also
.NET Code Module Support for 64-bit TestStand
AnyCPU Assemblies in 32-bit TestStand and 64-bit TestStand
Create Custom Data Type from Struct Dialog box
DotNetCall.LoadPrototypeFromSignature
Edit Search Directories dialog box
Parameters Table Context Menu for Module Tabs
Platform-Specific Assemblies in 32-bit TestStand and 64-bit TestStand