Exclude TFS DLLs During Publication

In one of my projects, I use an ASP.Net MVC site to communicate with Team Foundation Server (TFS) to display metrics/graphs/reports. The site is hosted on the same server that hosts TFS and during publication, it publishes the file Microsoft.TeamFoundation.WorkItemTracking.Client.DataStoreLoader.dll in the bin folder each time, which causes an ASP.Net error because the dll is already on the server.

It is possible in an ASP.Net MVC project to exclude files and directories by creating a .wpp.targets file. This allows you to define the exclusions as well as the source/reason for the exclusion.

In my case, here is my monprojet.wpp.targets file:

<Project ToolsVersion="4.0"
         xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
    
    <ExcludeFromPackageFiles Include="bin\Microsoft.TeamFoundation.WorkItemTracking.Client.DataStoreLoader.dll">
      <FromTarget>monprojet.wpp.targets</FromTarget>
    </ExcludeFromPackageFiles>
  </ItemGroup>
</Project>

So you can easily create your own exclusions!

Happy publishing

dll  tfs  publication  MVC  XML  WPP 

See also