简体   繁体   中英

WebDeploy using msbuild (TFS) error: file is in use

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM