I am using this code to convert MSTest code covarage results to XML format , I added reference to Microsoft.VisualStudio.Coverage.Analysis.dll bu there is no class called CoverageInfoManager . I am using VS 2010.
static void Main(string[] args)
{
String coveragepath = System.IO.Path.GetDirectoryName(args[0]);
CoverageInfoManager.SymPath = coveragepath;
CoverageInfoManager.ExePath = coveragepath;
// Create a coverage info object from the file
String coveragefile = System.IO.Path.GetFullPath(args[1]);
CoverageInfo ci = CoverageInfoManager.CreateInfoFromFile(coveragefile);
// Ask for the DataSet. The parameter must be null
CoverageDS data = ci.BuildDataSet(null);
// Write to XML
String coverageoutput = System.IO.Path.GetFullPath(args[2]);
data.WriteXml(coverageoutput);
}
If I use this code instead of above,
CoverageInfo coverage = CoverageInfo.CreateFromFile(@"....\data.coverage");
it throws an error saying "Image file "...\bin\Debug\TestProject1.dll" could not be found"