3

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?

dougajmcdonald
  • 19,231
  • 12
  • 56
  • 89
  • Do you deploy your stuff directly during build? – Stephen Reindl Feb 02 '15 at 20:31
  • We're using web deploy via IIS to deploy the site files if that's what you mean? – dougajmcdonald Feb 03 '15 at 09:15
  • Ah. So: Not a quick solution but you may use WIX or some other setup tool to deploy your software automatically. at least WIX has some functionality to stop/start the application during deployment. Another approach would be to stop/start the application pool via command line tool (https://technet.microsoft.com/en-us/library/cc732742%28v=ws.10%29.aspx). Both approaches require admin rights. – Stephen Reindl Feb 03 '15 at 17:57

1 Answers1

1

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.