TFS automated build failure when using MS Chart 'file' generation

240 Views Asked by At

We have a web application which uses MS Chart to produce some chart images.

The configuration for MS Chart uses Storage=file and as a result creates a bunch of temporary images when it's running.

Unfortunately when we trigger an automated build from TFS 2013 it fails saying:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets (4253): Web deployment task failed. (The file 'msc_cntr_0.txt' is in use.  Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE.)

If I go onto the test server and restart the App Pool and then retry the build it works.

Is this a known issue? can I get round it somehow via telling TFS/MSBuild to be more aggressive / restart the AppPool for me?

1

There are 1 best solutions below

0
On

The file msc_cntr_0.txt is generated by the remote IIS for charting, and remains locked as long as IIS is running. The problem is caused by MSDeploy trying to delete it during publishing, as this file is not in your local solution. In VS2013, there is a setting 'SkipExtraFilesOnServer' in your publish profile, which is 'False' by default. Setting it to 'True' solves the problem.