We are using the application initialization feature by setting startMode=AlwaysRunning and preloadEnabled=True in the octo configuration. We are using custom installation paths.
We find that often, deploys while purging the folder because a worker process has the files locked.
This happens even though our Pre-deployment script creates an app_offline file as well as tries to stop the app pool (using Stop-WebAppPool). We find that the app pool reports it is in the “Stopping” state indefinitely (using Get-WebAppPoolState). Even after several hours it’s stuck in this state. If we look at worker processes we see there is indeed a process with filehandles open in the installation folder.
The issue goes away if we switch startMode=OnDemand.
Has anyone seen issues like this when using application initialization in IIS (IIS 8.5/Win 2012R2)?