IIS App Pool locking deployment DLL

I use a normal package deployment step (ie not an IIS deployment) to deploy our web app. I want to keep the app pool running and simply take the app offline. I have a custom powershell step to copy an app_offline.htm file into the root. I then do my deployment and delete the file.

The issue is since we updated our SQL Server Spatial Types nuget package, the app pool locks the DLLs in the bin folder. Octopus can’t delete them so the deployment fails. The only way I can remove them is to stop the app pool and manually delete the files.

Does the support team have any ideas about how to get around this? I would like our offline page to remain up - so just stopping the app pool isn’t a viable option. One idea I had was to recycle the app pool as a powershell step. Or, would redoing our deployment process to use the IIS deployment step bundled with Octopus be better at handling this? I used a standard deployment because I needed the custom installation directory (and I think it wasn’t available in IIS at the time I set up our process).

Hamish,

Thank you for contacting us. My understanding is that placing the app_offline.htm file should release any open files, so I’m surprised that it isn’t behaving that way.

Do you still require the custom installation directory? The reason I ask is because the standard IIS deployment step handles things really nicely if a custom installation directory isn’t required. Each new deployment is pushed to a new directory on the target, and once everything has been written and configured, Octopus simple re-targets the IIS application to the new location. That means that the application doesn’t go down at all, and you’ll only observe that requests are slow to respond while the app pool recycles, which is the same when you use the app_offline.htm solution.

If you do require the custom installation directory, then unfortunately scripting an app pool recycle may be the only way to ensure that those files are actually released.

I hope that helps, and let me know how it goes!

Regards,
Jayden

We have a particularly finicky website so the custom installation directory is a must.

I simply added Restart-WebAppPool to the pre-script and it works fine.

And yeah, tell me about it. For some reason the app pool doesn’t release the SQL Server Spatial Types DLLs unless specifically told to recycle. I don’t even know why we need these assemblies, they’re a dep of a dep of a dep. Computers, hey.

Thanks for the help.

Hamish,

I’m glad you got it sorted. It is good to know that app_offline.htm doesn’t always work perfectly.

Please let us know if we can assist again in the future.

Regards,
Jayden

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.