Comments have been closed on this page. Please use AppMon & UEM Open Q & A forum for questions about this plugin.



NAnt Tasks Library for dynaTrace 2.6



dynaTrace Diagnostics Version



dynaTrace software


dynaTrace BSD






The Download Package includes an .NET Library that implements several tasks to be used by NAnt scripts.

Following tasks can be executed:

  • Start, Stop or Restart the dynaTrace Server
  • Start and Stop Session Recording
  • Change Active Configuration

This library makes use of the .NET Command Library.


  1. Save the attached file locally to the computer where the dynaTrace Diagnostics Client is installed.
  2. Unzip the file.
  3. Copy the extracted dlls to a directory where it can be picked up by NAnt when executing your build scripts
  4. View the extracted sample_nant.xml file. It shows how you can load the new build tasks in your NAnt scripts


You have to register the new Build Tasks with the UseTask configuration entry in your build scripts like this:

The following tasks with the listed properties can now be used in your NAnt scripts:


  • ProfileName: (mandatoy) - specifies the System Profile you want to start recording on 
  • RecordSessionName: (optional) - allows you to define the name of the recorded session
  • dtVersion: (optional) - this is the dynaTrace Client Version that you want to use. In case multiple versions of dynaTrace are installed you use this to connect to the correct version
  • dtInstallDir: (optional) - this is the dynaTrace Client Installation directory. If not specified the value is read from the registry
  • ServerName: (optional) - the dynaTrace Server Hostname to connect to. Default: localhost
  • Username: (optional) - the username to connect to the dynaTrace Server. Default: admin
  • Password (optional) - the password to connect to the dynaTrace Server. Default: admin


  • ProfileName: (mandatory)
  • dtVersion, dtInstallDir, ServerName, Username, Password: see description of StartSessionRecording


  • ConfigurationName: (mandatory) - configuration name to switch to
  • ProfileName: (mandatory) - System Profile where you want to switch the active configuration
  • dtVersion, dtInstallDir, ServerName, Username, Password: see description of StartSessionRecording


  • ServiceCommand: (mandatory). Allows one of the following values: startup, restart, shutdown
  • dtVersion, dtInstallDir, ServerName, Username, Password: see description of StartSessionRecording


  • Executable: (mandatory). Defines the full path to the executable you want to configure, e.g.: C:\MySample\MyApp.exe
  • Active: (mandatory). True or False. Allows to switch a configuration active or inactive
  • AgentName: (optional). Name of the Agent. Default: name of the executable file, e.g.: MyApp.exe
  • CommandLine: (optional). Command Line that must match the process. Default: empty==any command line value
  • ServerName: (optional). dynaTrace Servername to let the Agent connect to. Default: localhost
  • ServerPort: (optional). dynaTrace server port to let the Agent connect to. Default: 9998
  • LogFile: (optional). location where to store Agent logfile
  • LogLevelLife: (optional). LogLevel for the Log File. Possible Values: LOG_NONE, LOG_SEVERE, LOG_WARNING, LOG_INFO, LOG_FINE, LOG_FINER, LOG_FINEST. Default: LOG_NONE
  • LogLevelConsole: (optional). LogLevel for Console Loggin. Default: LOG_INFO


The Library uses the dtdcmd.jar file that is installed with the dynaTraceClient. The majority of the build tasks therefore calls the dtdcmd.jar file via command line - based on the properties and parameters that you have specified. For every dtdcmd.jar execution the library creates an EventLog Entry with detailed information about the command line arguments that were passed. This should help with troubleshooting.

The task ConfigureApplicationTask needs write access to the HKLM Registry on your local machine. In case your user does not have the appropriate access rights you will run into errors.

Sample NAnt Script

The download package includes a sample NAnt file. Check it out for a reference


  File Modified
ZIP Archive dynaTrace_DTNANTTasks_v1.0.zip Aug 14, 2008 by Andreas Grabner

  • No labels