Debugging
Copy
Aras Innovator has the following features for debugging/logging your Methods:
- Visual Studio to debug Methods either client or server.
- Logging of debug messages to an XML formatted log file.
Server method debugging is disabled by default in Aras Innovator 30. This setting saves disk space as the temporary dlls used for debugging the methods do not need to be created.
To enable the debugging of Server Methods, you can add the following line to your “InnovatorServerConfig.xml”, located in the root folder of your installation.
<operating_parameter key="DebugServerMethod” value="true” />
Server method debugging can then be disabled again by changing the value of this line to false.
After changing this value, you should restart IIS to confirm the change is applied.
- Open “Microsoft Visual Studio .NET” debugger.
- Choose Tools --> Attach to Processes….
- Choose
w3wp.exeand click ‘Attach’. - Choose Debug --> Exceptions to force the method into the debugger when an exception occurs and choose the check boxes “Thrown”.
- Optionally, you can include the line
System.Diagnostics.Debugger.Break()to force a breakpoint at a specific line in your method.
- Include the line
debugger,to your Method. - Press the F12 key while in your Internet Browser, or right-click and select ‘Inspect’, or ‘Inspect Element’. This will open a new dialog.
- Perform the action that runs the method code, and the code should pause itself once it reaches the
debugger, statement. - Afterwards, you can press F8 to continue running normally, F10 to perform another step of method code, and find javascript variable values using the Debugger Console.
Add the following lines to the InnovatorServerConfig61.xml file:
<operating_parameter key="debug_log_flag” value="true” /> <operating_parameter key="debug_log_prefix” value="C:/TEMP/DEBUG-" /> <operating_parameter key="debug_log_limit” value="1000" /> To write messages to the C:/TEMP/DEBUG-* log file, add the following line of code to the server-side method:
CCO.Utilities.WriteDebug(“logFileName”, “logMessage”);