JG Vimalan's Blog

It is all about coding!

Publish code coverage result via email

The following code explains the way to publish code coverage results via email.

This will happen during the contineous integration build in tfs, which executes the unit tests.

After you create a new build in tfs, you will get a .proj file. You need to add the following code in that file

to receive the code coverage results via email.
<?xml version=”1.0″ encoding=”utf-8″?>
<!– DO NOT EDIT the project element – the ToolsVersion specified here does not prevent the solutions
and projects in the SolutionToBuild item group from targeting other versions of the .NET framework.
<Project DefaultTargets=”DesktopBuild” xmlns=”http://schemas.microsoft.com/developer/msbuild/2003” ToolsVersion=”3.5″>


<UsingTask TaskName=”PublishCodeCoverge” AssemblyFile=”$(MSBuildExtensionsPath)\MyLibrary.MSBuild.Tasks.dll” />


<!– Team Foundation Build Version – DO NOT CHANGE –>


<Message Text=”Processing code coverage results…” />
<PublishCodeCoverge  CoverageFiles=”@(CoverageFiles)”
MailFrom=”My Project CI Build @Company.com”
AssemblyPath=”$(MSBuildExtensionsPath)” />



September 27, 2010 - Posted by | TFS


  1. Man, talk about a fantastic post! I?ve stumbled across your blog a few times within the past, but I usually forgot to bookmark it. But not again! Thanks for posting the way you do, I genuinely appreciate seeing someone who actually has a viewpoint and isn?t really just bringing back up crap like nearly all other writers today. Keep it up!

    Comment by suchmaschine | October 27, 2010 | Reply

  2. An awesome publish right there mate . Many thanks for posting .

    Comment by Abram Sinisi | September 7, 2011 | Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: