“Microsoft Test Manager cannot install test agent on these machines” when creating new Lab Center environment

半腔热情 提交于 2019-12-05 16:34:53

The best way to diagnose the problem is to activate MTM logging.

There is some blogs describing this activation via mtm.exe.config file (that is located in C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE for Visual Studio 2012).
See this one for example: How to enable logs for MTM?
But this did not work for me for some reasons.

The only way I could activate MTM logging was via registry keys.
For Visual Studio 2012 create a file with the following content, rename it so that it has .reg extension and double click on it in Windows Explorer:

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\EnterpriseTools\QualityTools\Diagnostics]
"EnableTracing"=dword:00000001 
"TraceLevel"=dword:00000004
"LogsDirectory"="C:\Temp"

Or just create these keys manually.

The EnableTracing variable controls whether tracing is ON (1) or OFF (0).
The TraceLevel variable is for level (granularity) of tracing:

  • 1 means Errors only
  • 2 is Errors and Warnings
  • 3 is Errors, Warnings and Information
  • 4 is All including Verbose Information

LogsDirectory is optional. If that is not specified, %TEMP% will be used.
Trace file name is <Process name>.EqtTrace.log, e.g. mtm.EqtTrace.log.

You should restart MTM after you've changed the registry.
And do not forget to deactivate logging once you solved the problem (set EnableTracing to 0).

Check the User name and Password on the "Machines" tab.
It will be set to the current user of the machine where MTM is running each time you open a test environment.

If this user is not a member of Administrators group on all machines in your environment you will get this error message during verification.

Run as administrator. I had the same issue in Microsoft Test Manager 2013, you just have to run it as administrator. Ate least worked for me!

I narrowed it down to two things.

After enabling MTM.exe.config logging as described here I noticed 2 files were created after trying to Verify the new Lab Environment:

  1. The MTM_Trace.log file had misleading content:

Cannot read primary file because of System.IO.FileNotFoundException: Could not find file 'C:\Users\p738753d\AppData\Local\Microsoft\Team Foundation\4.0\TestManagement\9dbaf515-0cad-4d11-b34e-cd083e6628eb_Aum.xml'.

This MSDN thread discusses missing these temporary files and the problem looks like its caused from a Trust between two domains. However, I believe this is a red-herring and the reason these (<GUID>_Aum.xml) files are not created is a symptom of an earlier problem seen in the second <GUID>MTMTrace.log file

  1. The <GUID>MTM_Trace.log file complains it cannot load the VideoRecorderEngine dll due to a BadImageFormatException:

Failed to load file 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\PrivateAssemblies\DataCollectors\Microsoft.VisualStudio.QualityTools.VideoRecorderEngine.dll'. Skipping data collector scan for this file. Error: System.BadImageFormatException: Could not load file or assembly 'file:///C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\PrivateAssemblies\DataCollectors\Microsoft.VisualStudio.QualityTools.VideoRecorderEngine.dll' or one of its dependencies. The module was expected to contain an assembly manifest. File name: 'file:///C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\PrivateAssemblies\DataCollectors\Microsoft.VisualStudio.QualityTools.VideoRecorderEngine.dll'

In my experience DLL BadImageFormatException load problems tend to be caused by x86 and x64 compilation.

In any case, I suspected the problematic VideoRecorderEngine.dll was needed for the environment to run UI Tests, so I turned that off:

Then the verification was successful:

I'm not sure if adding the service account to the Admin Group was needed but I did it - thanks Elena!

Finally I disabled the logging from the MTM.exe.config.

try running MTM as administrator, and Provide the correct computer name while adding the machine. Worked for me..

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!