Is it possible to use app_offline.htm when publishing via ftp?

1.4k Views Asked by At

Is it possible to configure Visual Studio 2012 to automatically create (and delete) the app_offline.htm file when using ftp as the publishing method?

I tried to create the file by hand and add it to the solution (so it would be uploaded automatically and I could delete it by hand once the publishing process is done).
But because it exists in my solution, every request is redirected to it and I can't debug anything.

Changing the name to app_offline.htm.deactivated during development and changing it back to app_offline.htm before publishing doesn't seem like a perfect solution.

If VS12 doesn't support this natively, I would be happy to use any available extension.

Edit: I noticed, that the app_offline.htm file is created when activating delete all content before publishing but not when this option isn't selected.

Inserting <EnableMSDeployAppOffline>true</EnableMSDeployAppOffline> to the .pubxml file didn't change anything.

1

There are 1 best solutions below

2
On

From: http://www.asp.net/mvc/tutorials/deployment/visual-studio-web-deployment/deploying-a-code-update

It says:

You can configure Web Deploy to automatically put a default app_offline.htm file on the server when it starts deploying and remove it when it finishes. To do that all you have to do is add the following XML element to your publish profile (.pubxml) file:

<EnableMSDeployAppOffline>true</EnableMSDeployAppOffline>