Update: Microsoft released a QFE to address the issue outlined below.
Here is a summary of the list of issues fixed by the QFE, to help you decide whether you should apply the QFE:
Issue 1: When you run tests on the test agent that is installed on a computer that has Visual Studio 2010 SP1 installed, the tests may not run, and the following error message is logged:
Attempted to access an unloaded AppDomain. (Exception from HRESULT: 0x80131014)
Issue 2: When you run a playback of a Coded UI Test on certain Windows Presentation Foundation (WPF) controls, a Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException exception occurs, and then you receive the following error message:
“Search may have failed at ‘<name>‘ <control type> as it may have virtualized children. If the control being searched is descendant of ‘<name>‘ <control type> then including it as the parent container may solve the problem.”
Issue 3: When you try to create a work item from the Test Results pane in Visual Studio 2010 after you connect to a Team Foundation Server (TFS) server, a System.OutOfMemory exception occurs, and the creation operation fails. This issue usually occurs if the TFS server has many builds.
Issue 4: When some tests run in a build operation, some builds that are queued in a TFS server stop responding. Additionally, the following error message is logged in the build log:
Waiting to publish…
Publishing results of test run <build name> to http://<TFS server address>:8080/tfs/DefaultCollection…
The process cannot access the file ‘<directory>data.coverage’ because it is being used by another process.
Publish failed or canceled.
As I was preparing for a demo of lab management the other day I did what we tell all of our customers to do – patch everything to latest service packs which of course included TFS SP1 on all of our machines. That includes the TFS server and all build servers and virtual lab environments.
By the way, using the lab prep tool you must manually install SP1 after the VM is prepped otherwise you get a few errors. But I digress.
After I patched everything I ran a test to verify that everything worked. I created a manual test, recorded it and turned it into a CodedUI test with validations. All went smoothly. Then I ran a lab build and got a failure. Looking at the automated test run (MTM > Testing Center > Test > Analyze Test Runs I noticed the following log:
|ID||Date & Time||Message|
|1||04/06/2011 21:06:06||Preparing to execute test run .|
|2||04/06/2011 21:06:06||Test run is executed by Process: ‘QTController’, User: xxxx, Controller: xxxx, Environment: ‘LabDemo.All Hosts_Demo.Test Env’.|
|3||04/06/2011 21:06:06||Loading the test settings for test run .|
|4||04/06/2011 21:06:06||Adding test case  to test run .|
|5||04/06/2011 21:06:07||Executing the initializing plugin for test run .|
|6||04/06/2011 21:06:07||Changing the test run state from ‘Initializing’ to ‘In Progress’.|
|7||04/06/2011 21:06:07||Executing test run starting plugin for test run .|
|8||04/06/2011 21:06:07||Starting test run .|
|9||04/06/2011 21:06:07||Created a TMI run with ID [20507d65-c49b-442f-bb56-47c8fff0bc37] for test run .|
|10||04/06/2011 21:06:07||Queued the TMI run for test run .|
|11||04/06/2011 21:06:09||Updating the result of test case .|
|12||04/06/2011 21:06:09||The test results are saved successfully.|
|13||04/06/2011 21:06:09||Executing the test run completed plugin for test run .|
|14||04/06/2011 21:06:09||Test run  completed.|
|15||04/06/2011 21:06:09||The execution log reported by TMI for test run :|
|16||04/06/2011 21:06:09||Timestamp ‘4/7/2011 4:06:08 AM’; TestOutcome ‘Error’; Message ‘Attempted to access an unloaded appdomain. (Exception from HRESULT: 0x80131014)’.|
|17||04/06/2011 21:06:09||Timestamp ‘4/7/2011 4:06:08 AM’; TestOutcome ‘Warning’; Message ‘Test run xxxx 2011-04-06 21:06:07′ could not be executed on controller xxxx. The test run was stopped or aborted while waiting for diagnostic data adapters to initialize.’.|
|18||04/06/2011 21:06:09||Timestamp ‘4/7/2011 4:06:09 AM’; TestOutcome ‘Error’; Message ‘Attempted to access an unloaded appdomain. (Exception from HRESULT: 0x80131014)’.|
You will note the last three items. Even though the test log shows that the test executed successfully, it did not. If you remove the diagnostic data adapters, the error on line 17 will be removed but the errors on 16 and 18 continue.
It turns out that when SP1 was released, it caused a problem with the test agent running in the lab environment. A simple solution for my needs was to uninstall SP1 from the machines in the lab environment and everything ran fine again – or so I thought. However, when you do this, IntelliTrace does not work because of the mismatch between the external test controller (patched to SP1) and the internal test agent (RTM). Or so I believe right now.
Microsoft has confirmed this to be a problem and they are actively working on a QFE for this. I will drop another post once this QFE is released.