The Object Browser supports debugging of scripts, templates, format scripts, table scripts, processes, and methods. You can make use of the Visual Studio debug options for this purpose. You cannot alter the scripts, templates, formatting rules, table scripts, processes, or methods. Correct the errors in the Designer.
Prerequisites
-
To use the debug function in the Object Browser, you must install the following software:
-
The user requires the Common_CompileForDebug program function. This provides the user with an additional compiler option in the Configuration Wizard for creating local debug assemblies.
In the Designer, assign the program function to a custom permissions group and add the system user to this permissions group. For more information about controlling conditions with program functions, see the One Identity Manager Authorization and Authentication Guide.
-
Local debug assemblies are available on the user's local workstation.
Detailed information about this topic
To generate local debug assemblies
-
In the Database Compiler, on the Compiler settings page, set the Create debug information option.
-
Select the Scripts including all dependencies compiler setting.
-
Start the compiler.
During compilation you will see more messages that refer to creating the debug assemblies locally. Some compiler steps, for example, compiling web projects, are skipped because they cannot be debugged locally.
The Database Compiler saves the assemblies and associated PDB files in the %USERPROFILE%\AppData\Local\One Identity\One Identity Manager\AssemblyCache directory on the local computer.
The source code is saved in the %USERPROFILE%\AppData\Local\One Identity\One Identity Manager\AssemblyCache\Sources directory.
Therefore, the assemblies are not transferred to the database.
NOTE: You can debug locally until assemblies without debug data are generated on the workstation or new assemblies are loaded over a database connection.
To debug in the Object Browser
-
Start the Object Browser and select the Debug > Debugger start/stop menu item.
Visual Studio opens and the Object Browser is connected to the debugger. This process may take a few moments. If Visual Studio connection can be established, the Manage breakpoints dialog opens.
-
In the Manage breakpoints dialog, you can define different breakpoints for scripts, templates, format scripts, table scripts, processes, and task definitions.
-
To define a new breakpoint, click and select one of the following options:
-
Script processing: Adds a breakpoint of Script type. Under Breakpoint operation, select a script.
-
Column processing: Adds a breakpoint of Column type. Under Breakpoint operation, select a format script, template, or script for conditionally removing permissions.
-
Table processing: Adds a breakpoint of Table type. Under Breakpoint operation, select a table script.
-
Process generation: Adds a breakpoint of Process type. Under Breakpoint operation, select a process.
-
Object method: Adds a breakpoint of Object method type. Under Breakpoint operation, select a task definition.
-
To use an existing breakpoint, select it in the list.
-
To delete a breakpoint, select it in the list and click .
-
To delete all breakpoints, click .
-
Click OK.
This closes the Manage breakpoints dialog. The breakpoint definitions are transferred to Visual Studio.
NOTE: You can open the Manage breakpoints dialog again from the Debug > Configure breakpoints menu.
-
In the Object Browser, run the actions that you want to debug, for example, call a script, run a column template, or generate a process.
The moment the action is about to be run, Visual Studio is brought into the foreground and opens the place in the source code with the selected breakpoint. From this point on, all of Visual Studio's comprehensive debugging options are available to you in full. For example, use F10 to step through the code line for line or use F5 to continue with the program.
-
After you have completed debugging, select the Debug > Debugger start/stop menu item to
disconnect Visual Studio from the Object Browser and close it.
Related topics
Problem
In the Database Compiler, the Create debug information is not shown.
Cause
The system user used is not assigned the Common_CompileForDebug program function through its permissions groups.
Solution
In the Designer, assign the program function to a custom permissions group and add the system user to this permissions group. For more information about controlling conditions with program functions, see the One Identity Manager Authorization and Authentication Guide.
Problem
The Debug menu is not shown in the Object Browser.
Possible cause
Possible solutions
Problem
Breakpoints are shown as disabled in Visual Studio.
Cause
Breakpoints are shown as disabled if the assembly with the function to be debugged is yet not loaded into memory. For example, the assemblies for generating processes are not loaded into the application until the point of generation. From then on the breakpoint is enabled and you can jump to it.
Problem
Breakpoints in Visual Studio are always shown as disabled and you cannot jump to them.
Possible cause
Possible solution
If Visual Studio is connected the Object Browser, switch to Visual Studio and open the Debug > Windows > Modules. Here you will find a list of all the modules that are loaded and additional information.