Search code examples
tfsmsbuildmsbuild-task

Automating builds with MSBUILD/TFS 2010/MSBuild.ExtensionPack


I need to create a build that is schedule from TFS 2010 and does the following:

  1. Get latest source
  2. Compile the project
  3. Check AssemblyInfo.cs files out and increment the version using Msbuild.ExtensionPack
  4. Check the files back in
  5. Deploy the Database project against a target database
  6. Run unit tests

I am thinking of putting all these steps into one of my project's .csproj files and scheduling the build from Visual Studio using Team Explorer. Is this a good strategy? In preparation to this, I tested out the MSBuild.ExtensionPack.VistualStudio.TfsSource Checkout, and I get an error on my assembly files with the following message:

c:\_dev\NDA\API\API.csproj : warning : Exit Code 1. Partial success: No matching items found in c:\_dev\nda\API\Properties\AssemblyInfo.cs in your workspace.

However, if I run tf checkout from command line, it works fine. What could be causing this error?

Thanks!


Solution

  • It's not a good idea to check-out or check-in items during a build process. By the way for versioning purposes I use Jim Lamb's ActivityPack described here. It works very well for me.