I am trying to integrate Dynatrace with TFS 2010 to generate Dynatrace report after each build.
The first step consists in cutomizing the TFS build template to integrate new tasks driving Dynatrace through the REST interface. It works fine.
Now, I need to configure Dynatrace to monitor the application code. When running a build, the automated tests are run through MSTest (on my server the location is : C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe).
To do this task, I add an agent triggering the process MSTest.exe through dynaTrace .NET Agent Configuration.
I also add a new System Profile triggering the agent.
The issue is that Dynatrace does not monitor my code. Even if I run MSTest through command line (ex : mstest /testcontainer:TestIntegrationContinue.Test.dll), nothing happens.
My question is : have you already integrated Dynatrace into TFS? Did you manage to monitor code when it is launched by MSTest ?
Answer by Jeff F. ·
If you have VisualStudio 2010 or later, you should hook QTAgent.exe and/or QTAAgent32.exe. MSTest.exe just reads the test information from your assemblies and passes the information on to QTAgent.exe to run the actual tests.
QTAgent.exe is also used when running tests from Visual Studio 2010, so configuring the agent for QTAgent.exe will also allow dynaTrace to see those test executions.
Answer by Andreas G. ·
There are two possible explainations why you do not see dynaTrace picking up PurePaths
a) you need a machine restart after installing the .NET Agent so that all processes that launch MSTest have the COR_* environment variables set and pass them along MSTest. When TFS launches MSTest this might be a necessary step
b) another .NET tool overwrites our COR_* environment variables and prevents our .NET Agent to be loaded. To check this you can use Process Explorer and check the enviornment variables of the mstest process. Check which values the COR_* environment variables have. dynaTrace sets these values to allow the .NET Runtime to load our .NET Agent. Other tools may overwrite these settings, such as the Visual Studio Profiling tools
Hope this helps you for your next steps. There should be no problem to instrument MSTest whether it is executed by TFS or from the console
Check what has changed for SaaS, Managed, and Dynatrace API in version 170.
See release notes
Join our hands-on introduction to Dynatrace's brand new IBM System z Mainframe Support!
Wednesday, June 12, 2019
Learn how to set business hours per application, manage report users from a single dashboard, use the configuration REST API, and many more!
Wednesday, June 12, 2019