We’ve been deploying this API application for ages with no troubles. Recently it has begun failing to deploy most of the time with messages like:
Microsoft.Web.Deployment.DeploymentDetailedClientServerException: Web Deploy cannot modify the file 'msvcr120.dll' on the destination because it is locked by an external process. In order to allow the publish operation to succeed, you may need to either restart your application to release the lock, or use the AppOffline rule handler for .Net applications on your next publish attempt. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE.
September 24th 2019 14:39:39Error
at Microsoft.Web.Deployment.StatusThreadHandler.CheckForException()
September 24th 2019 14:39:39Error
at Microsoft.Web.Deployment.PackageSerializer.SerializePayload(DeploymentObject obj, Int32 objectId)
September 24th 2019 14:39:39Error
at Microsoft.Web.Deployment.PackageSerializer.SerializeChildrenDepthFirst(SerializeObjectContext objectContext)
September 24th 2019 14:39:39Error
at ....
I have tried using the appoffline setting to ensure that the app is offline when deploying, but it does not seem to have any effect.
How can we fix this?
Edited to add:
I’ve googled this a bit and it has come up in the past with Octopus several time. There never seems to be a satisfactory resolution, or at least not one that details the steps to overcome this issue.
However, something I’ve noticed is that despite loads of requests, and several assurances, the text on the step template still refers incorrectly to an app_offline.html file (instead of app_offline.htm) which makes me wonder whether you just have the wrong filename still: