Gulp tasks and TFS

Having TFS on board can be pleasure and pain in the same time. I like TFS for it’s integration with Visual Studio, great support for Code Review and checkin polices. But on the other hand it sometimes just gets in my way. I have a feeling that integration between newly on-boarded ASP.NET 5 tools like bower or gulp and TFS Visual Studio tooling can be a little better and that it’s designed more to be used with Git or Svn.
One of the problems I had with TFS is that every time I started gulp task to clean css and javascript files and recreate them again I was stuck with message like

The check-out check-in model used in TFS sets all the files to read only. Having this attribute and using any file task like gulp-concat or gulp-cssmin for generating frontend assets results in error.

TFS tooling for Visual Studio pick up all new files in solution and adds them to source control. This involves all newly generated files as well.
Easy one I said to myself at the beginning – you just have to tell source control to ignore those files. TFS surely have easy enough interface to do that. How surprised and mistaken I was.
Quick googling reveals that it’s actually a hard task and all of them were incompatible for my environment and local requirements.
To make the long story short the best solution I have found was to set workspace as ‘Local’.

  1. Open Source Control Explorer
  2. Navigate through the list of your workspaces and choose Workspaces… option to open Manage Workspaces window
  3. Choose your workspace and click Edit
  4. In advanced section change Location to Local

This solution removes read only attribute from files on disk and allows access for other processes.

Leave a Reply