Overview

Allows you to call dynaTrace automation tasks from MSBuild

Name

MSBuild Tasks Library

Version

1.0.0

dynaTrace Versions

5.x, 6.x

Author

dynaTrace software

License

dynaTrace BSD

Support

Supported

Download

Description

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

Following tasks can be executed:

This library makes use of the .NET Command Library.

Installation

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

Usage

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

<UsingTask AssemblyFile="dynaTrace.MSBuild.Task.dll" TaskName="dynaTrace.MSBuild.Task.StartSessionRecordingTask" />
<UsingTask AssemblyFile="dynaTrace.MSBuild.Task.dll" TaskName="dynaTrace.MSBuild.Task.StopSessionRecordingTask" />
<UsingTask AssemblyFile="dynaTrace.MSBuild.Task.dll" TaskName="dynaTrace.MSBuild.Task.SetActiveConfigurationTask" />
<UsingTask AssemblyFile="dynaTrace.MSBuild.Task.dll" TaskName="dynaTrace.MSBuild.Task.ServerServiceTask" />
<UsingTask AssemblyFile="dynaTrace.MSBuild.Task.dll" TaskName="dynaTrace.MSBuild.Task.ConfigureApplicationTask" />
<!-- for dynaTrace 3.5 - 6.0 -->
<UsingTask AssemblyFile="dynaTrace.MSBuild.Task.dll" TaskName="dynaTrace.MSBuild.Task.SetTestInformation" />
<!-- for dynaTrace 6.1 and above -->
<UsingTask AssemblyFile="dynaTrace.MSBuild.Task.dll" TaskName="dynaTrace.MSBuild.Task.StartTestTask" /> 

Each task can now be used in your targets. Following properties are available for the different tasks:

StartSessionRecordingTask

StopSessionRecordingTask

SetActiveConfigurationTask

ServerServiceTask

ConfigureApplicationTask

SetTestInformation (from dynaTrace 3.5 till dynaTrace 6.0)

StartTest (from dynaTrace 6.1)

StartTest task registers a new test run in dynaTrace and sets the DT_TESTRUN_ID environment variable picked up by the .NET agent. Tests should be executed after this is made so that the agent sees the environment variable and will use it when reporting data back to dynaTrace.

Internals

The Library uses the dynaTrace.Command.dll which is installed with the dynaTrace Client. dynaTrace.Command.dll uses the dynaTrace Web Service interfaces. For every dynaTrace.Command.dll call 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 MSBuild Script

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

An additional sample can be seen here:  VSTS Sample Test Project

Attachments