0

enter image description here

The text of the error is:

web deploy cannot modify the file on the destination because it is locked by an external process in iis Remote Server

How can I investigate this?

halfer
  • 19,824
  • 17
  • 99
  • 186
Kiran290
  • 1
  • 1

2 Answers2

0

If you are using VS tooling to publish using an msdeploy profile, then this property is automatically added to your pubxml.

True

In your output window you should see an msdeploy command similar to this.

"C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" -source:manifest='C:\Users\vramak\AppData\Local\Temp\PublishTemp\obj\SourceManifest.xml' -dest:manifest='C:\Users\vramak\AppData\Local\Temp\PublishTemp\obj\DestManifest.xml',ComputerName='https://netcoreappwithdb.scm.azurewebsites.net/msdeploy.axd',UserName='$netcoreappwithdb',Password='{PASSWORD-REMOVED-FROM-LOG}',IncludeAcls='False',AuthType='Basic' -verb:sync -enablerule:AppOffline -enableRule:DoNotDeleteRule -retryAttempts:20

-enablerule:AppOffline in the command should take care of adding the appOffline during deployment.

If custom appOffline content is needed, you can set this property in pubxml.

Path to app offline

Arjun Ghimire
  • 233
  • 1
  • 6
  • Hi Arjun, Thanks for your Reply, Not Understand Clearly my problem is when I publish to IIS it showing IIS locked by DLL – Kiran290 Jan 04 '20 at 04:31
0

The reason behind the issue is some of your files at the target of your publishing being in use, so they cannot be overwritten.

You could follow the below ways to resolve your issue:

Try to restart your app service. if your issue still exists every single time when you’re trying to deploy your changes to the server, especially in your development environment, and even more so, if it fails your automated deployments, this solution is not suitable.

Another way is you can also just modify the application settings to instruct MSDeploy to rename the files it can’t overwrite – it usually solves this issue! There are 2 ways to do that.

1)Edit the application settings at the target of your publishing:

Open your Azure Function’s/App Service’s application settings, and add the following key-value pair:

MSDEPLOY_RENAME_LOCKED_FILES = 1

enter image description here

2)Edit the publishing settings for MSDeploy:

Using Visual Studio for development, you can access the settings by clicking “Publish” on your project, and then clicking “Manage application settings” in the new window.

enter image description here

If the version is different then you can find clicking on the link to manage app (service) settings, you’ll get to a window like this, where you can just add the setting by clicking “Add”:

enter image description here

And add the new setting, something like below:

enter image description here

You could also refer this below link for more detail:

azurew website continuous deployment - Web Deploy cannot modify the file 'XXX' on the destination because it is locked by an external process

Jalpa Panchal
  • 8,251
  • 1
  • 11
  • 26