Last week I stopped getting code coverage as part of the Team Build (aka TFS MSBuild) in my project. I started digging in and found the following error popping up in my build output file:
MSBUILD : warning : Publish Failed. Test Type not installed on the server for test type: "Microsoft.Samples.VisualStudio.TestTools.HostAdapters.VsIde.RunConfigData".
This error ate about 16 hours of time in the this week and I only kind of have it solved. (I only kind of have a handle on what was going wrong.) It looks like problem started when I installed the Visual Studio 2005 SDK Dec 2006 (CTP). It installed a custom test type sample into Visual Studio and ended TfsBuild's ability to upload test results to TFS. More precisely, this custom test type added extra “stuff“ to my testrunconfig's that TFS didn't know about. Since TFS didn't have the DLLs for this custom test type, it couldn't handle (de-serialize) the result format and BOOM!
My first step was to uninstall this custom test type by going to
C:Documents and SettingsAll UsersApplication DataMicrosoftMSEnvSharedAddins and deleting (or renaming) the file VsIdeTestHost.AddIn. (Doing this probably didn't have any effect but this addin was making me angry and --- IT WAS JUSTICE, DAMMIT! IT NEEDED TO GO AWAY!)
Ok. Now let's deal with the corrupted testconfig. Open up your solution, right-click the offending testrunconfig file, and select “Open With...“ Choose “Xml Editor“ and click “OK“. When the file opens, hit CTRL-F and search for “sample“.
You'll find an XML element named “value“ with the type attribute set to “Microsoft.Samples.VisualStudio.TestTools.HostAdapters.VsIde.RunConfigData“.
Now back up a few levels in the XML until you find the “hostData“ element that contains this “value“. It should look something like the value below:
Select the “hostData“ element, delete it, and save the testrunconfig file.
Check in the file and re-run your team build. Your build should be able to publish the test results to TFS now.
What's kinda sucky is that I haven't figured out how to permanently fix this problem with the testrunconfig. Each time that I make a modification to the testrunconfig, I have to go through the process of deleting the “hostData“ again.
If anyone has any good ideas, let me know.
-Ben