Answered by:
TFS 2013 Build-Deploy-Test failing for missing dll 'Microsoft.VisualStudio.QualityTools.Common'

Question
-
Hi,
I'm running TFS 2013 and have a simple MVC application that has some automated unit tests I want to run these using the Build-Test-Deploy template. To install the application for the tests I have a powershell script that runs as set up by the test settings to copy my build drop folder to the test agent and create the website for the application on the local IIS. If I run the tests from Microsoft Test Manager they run fine but when they run as part of the build-deploy-test workflow I get the following error. As part of the test settings I have configured the Unit Test add-in to search the folder I copy the drop to as the root folder to search for the assemblies to be loaded.
I am getting the following error when the build runs:
Any ideas/help would be great as I've been looking at this for 2 days now with no luck!
Thanks
- Edited by cjfarrelly Tuesday, December 23, 2014 1:07 PM bad heading
Monday, December 22, 2014 4:15 PM
Answers
-
Hi,
You don’t need to create a unit test Add-in in MTM test settings file in order to copy the build drop folder to the test agent machines. During running test in MTM lab environment, test controller automatically deploys the test binaries and their dependencies from the build drop location to the test agent machines so that test agent can run them. If you want to install the website under test to test agent machine, you only need to use the Deploy task in TFS build-deploy-test workflow as I mentioned before.
Also the dll in the original error is here, correct version too.
The assembly: Microsoft.VisualStudio.QualityTools.Common was copied to the C:\Deploys folder which includes the website file, right? As far as I know, generally a simple unit test does not need such assembly. I assume your unit test need this assembly. I doubt whether the necessary assemblies were copied to the C:/Deploy directory instead of the default and expected directory on test agent machine, which affected how test run found this assembly. So please don’t copy the whole build drop folder to C:/Deploy. You only need to deploy the website to C:/Deploy and install it to test agent machine through deployment script.
Thanks,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- Proposed as answer by Amanda Zhu Tuesday, December 30, 2014 8:15 AM
- Marked as answer by Amanda Zhu Friday, January 2, 2015 3:11 AM
Wednesday, December 24, 2014 3:20 AM
All replies
-
Hi,
Please check the log to confirm what step the error occurred. Build, deploy or test process? If possible, you can post the whole log information here so that we can further look at this issue.
It seems you install the application under test through setting up a powershell script in test settings file. Not sure what test settings file you meant by, test settings file in MTM or in Visual Studio? Since you are using Build-Deploy-Test template, then you don’t need to make script setup in test settings file to copy the drop folder to test agent machine and create website on local IIS. You can accomplish it in Deploy process. You just need check ‘Deploy the build’ and specify the deployment scripts to be run on the test agent machine. For detailed information about Deployment in Build-Deploy-Test workflow, please see ‘Add the details for your workflow’ in this document: Create a build-deploy-test workflow for a standard environment
About how to create deployment script, please reference this document: Creating deployment scripts for build-deploy-test workflows
Thanks,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.Tuesday, December 23, 2014 7:17 AM -
Hi,
Thanks for the reply. Sorry I wasn't a bit clearer in describing the problem.
I install the application by running a powershell script as part of the deploy task in the build-deploy-test build. This just appears to me to be the same idea as the test settings file in MTM...maybe not?
The error is showing as part of the Run Tests task in the build.
Run Tests 00:00 Running Tests Initial Property Values BuildDefinitionName = Sandbox_CI BuildNumber = Sandbox_CI_20141222.12 LabEnvironmentUri = vstfs:///LabManagement/LabEnvironment/4 MaxConsecutiveFailuresToIgnoreDuringWaitForCompletion = 3 MaxWaitTime = 00:00:00 RefreshInterval = 00:01:00 TestDirectory = \\Dev\Builds\Sandbox_CI\Sandbox_CI_20141222.12 TestEnvironment = TestParameters = Test plan=Automated Tests;Test suites=Automated Tests;Test configuration=Windows 8;Automated test settings=Cora-Automated; Title = MVCSampleApp_Test_20141222.19 Exception Message: Could not load file or assembly 'Microsoft.VisualStudio.QualityTools.Common, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. (type FileNotFoundException) Exception Stack Trace: at Microsoft.TeamFoundation.Lab.Workflow.Activities.ExecuteRemoteTestRun2.TestRunCreation.CreateTestRun(CodeActivityContext context, ITestManagementService testManager, ITestManagementTeamProject project) at Microsoft.TeamFoundation.Lab.Workflow.Activities.ExecuteRemoteTestRun2.TestRunCreation.Execute(CodeActivityContext context) at System.Activities.CodeActivity`1.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation) Final Property Values BuildDefinitionName = Sandbox_CI BuildNumber = Sandbox_CI_20141222.12 LabEnvironmentUri = vstfs:///LabManagement/LabEnvironment/4 MaxConsecutiveFailuresToIgnoreDuringWaitForCompletion = 3 MaxWaitTime = 00:00:00 RefreshInterval = 00:01:00 Result = TestDirectory = \\Dev\Builds\Sandbox_CI\Sandbox_CI_20141222.12 TestEnvironment = TestParameters = Test plan=Automated Tests;Test suites=Automated Tests;Test configuration=Windows 8;Automated test settings=Cora-Automated; Title = MVCSampleApp_Test_20141222.19
Tuesday, December 23, 2014 9:48 AM -
Hi,
Please look for this assembly Microsoft.VisualStudio.QualityTools.Common, Version=12.0.0.0 on the test agent machine where the test will run to check whether this assembly exists on that machine.
Whether the application was deployed to the test agent machine successfully?
You said that the test can be run fine from MTM. Whether this problematical test agent machine run the test successfully previously?
If possible, please copy the test files to that machine and run the test to check whether the test can run fine.
In addition, what version are your VS, test controller and Test agent?
Thanks,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.Tuesday, December 23, 2014 10:02 AM -
Hi,
Thanks again for the fast reply!
I have a single test controller running on Server2012R2 and a single test agent running on Window8.1.
MTM runs the test fine on the TA, I can open cmd prompt on the TA and run the test using mstest from the command line with no problems.
Visual Studio, TFS, TC and TA are all 2013 with latest updates, freshly downloaded and installed from MSDN last week.
It appears to me that the test task in build-deploy-test is looking in a strange folder for my deployed dll's, but I have no idea how to find out where it might be looking or how to change it. I'm going through those links you sent me at the moment to see if I've missed anything or if there is another approach I can use for this.
Thanks
Tuesday, December 23, 2014 10:28 AM -
Also just to clear up what I meant by test settings in MTM, I put the following into the test settings to try and point towards the folder where the powershell copies the build too as part of the deploy task (C:\Deploys). This is the folder I can open cmd prompt in and run the tests from using mstest on the command line with no problems. Also the dll in the original error is here, correct version too.
Tuesday, December 23, 2014 10:53 AM -
Hi,
You don’t need to create a unit test Add-in in MTM test settings file in order to copy the build drop folder to the test agent machines. During running test in MTM lab environment, test controller automatically deploys the test binaries and their dependencies from the build drop location to the test agent machines so that test agent can run them. If you want to install the website under test to test agent machine, you only need to use the Deploy task in TFS build-deploy-test workflow as I mentioned before.
Also the dll in the original error is here, correct version too.
The assembly: Microsoft.VisualStudio.QualityTools.Common was copied to the C:\Deploys folder which includes the website file, right? As far as I know, generally a simple unit test does not need such assembly. I assume your unit test need this assembly. I doubt whether the necessary assemblies were copied to the C:/Deploy directory instead of the default and expected directory on test agent machine, which affected how test run found this assembly. So please don’t copy the whole build drop folder to C:/Deploy. You only need to deploy the website to C:/Deploy and install it to test agent machine through deployment script.
Thanks,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- Proposed as answer by Amanda Zhu Tuesday, December 30, 2014 8:15 AM
- Marked as answer by Amanda Zhu Friday, January 2, 2015 3:11 AM
Wednesday, December 24, 2014 3:20 AM -
Hi Cjfarrelly,
Merry Christmas to you.
If you have any concern and result, please feel free to come back.
Thanks,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.Friday, December 26, 2014 6:52 AM