1
votes

I have standard TFS build definition with the following msbuild arguments for web deployment:

/p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish  /p:MSDeployPublishMethod=InProc  /p:CreatePackageOnPublish=True  /p:DeployIisAppPath="[IIS APP PATH]" /p:MsDeployServiceUrl=localhost

This approach was ok unless I added a locked 'logs' folder to the application. Now msbuild is unable to delete this folder because it is always in use. Here is the error:

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

I guess there must be a way to recycle webapp prior deployment and therefore release the folder. Or maybe do not cleanup source location. Please advise.

Thanks

1

1 Answers

1
votes

Eventually I found a solution to the problem above:

/p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish  /p:SkipExtraFilesOnServer=True /p:MSDeployPublishMethod=InProc  /p:CreatePackageOnPublish=True  /p:recycleApp="[APP NAME]"  /p:DeployIisAppPath="[APP NAME]" /p:MsDeployServiceUrl=localhost

Parameter SkipExtraFilesOnServer does not perform cleanup destination folder and therefore logs folder is unaffected.