Module.CreateCode
- Updated2025-07-21
- 1 minute(s) read
Module.CreateCode
Syntax
Module.CreateCode
Return Value
Indicates whether the module was modified.
Purpose
Creates code for the module.
Remarks
The contents of the code depend on the adapter used to create the module, the settings for the module, and the code templates configured for the step type of the step that contains the module. Use the Module.CanCreateCode property to determine whether this step can create code with this method.
For adapters that use Microsoft Visual Studio, calling this method can result in prompts to the user if any of the following conditions exist:
- Multiple versions of Visual Studio exist on the computer and you select the Always Prompt for Version option from the Version of Visual Studio to Use for Create and Edit Code ring control in the Adapter Configuration dialog box.
- Multiple versions of Visual Studio exist on the computer and you select the Use the Version that Matches the Project File option from the Version of Visual Studio to Use for Create and Edit Code ring control in the Adapter Configuration dialog box, and TestStand cannot match the version of the file.
- A method already exists with the same name.
- The specified solution does not contain the specified project.
- The specified project does not contain the specified source file.
For DotNetModule objects, use the DotNetCall.CreateCode method instead of this method.