cleantestresults XML Snippet

About a year ago, I wrote about an automated way to clean up the TestResults folder created by VSTS. While I still use this approach methodically, I've begun to find it tedious to find my original post to copy and paste the XML into the project file. For this reason, I've created an XML code snippet that inserts the relevant elements:

<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets  xmlns="">
  <CodeSnippet Format="1.0.0">
      <Description>Code snippet for cleaning the TestResults folder. Only to be used from an MSBuild file.</Description>
      <Author>Mark Seemann</Author>
        <Literal Editable="false">
      <Code Language="XML">
<Target Name="AfterClean">
  <RemoveDir Directories="$Dollar$(TestResultsFolderPath)" Condition="Exists('$Dollar$(TestResultsFolderPath)')" />

I've also included this snippet as an attachment to this post, so the easiest way to use this is to download it and put it into your <documents>\Visual Studio 2005\Code Snippets\XML\My Xml Snippets folder.

To insert this snippet when editing a project file in Visual Studio, just hit Ctrl+K, X (or click EditIntellisenseInsert Snippet).


Comments (0)

Skip to main content