发布期间自定义 app_offline.htm 文件 [英] Custom app_offline.htm file during publish

查看:29
本文介绍了发布期间自定义 app_offline.htm 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我发布我的 ASP.NET MVC 应用程序时,它会生成一个 app_offline.htm 文件,以便在更新网站时使网站脱机,然后在发布成功后删除该文件.

When I publish my ASP.NET MVC application it generates a app_offline.htm file to take the site offline while it updates the website and then deletes the file once the publish is successful.

这很酷,我真的很喜欢这个想法,但我想创建自己的自定义 app_offline.htm 文件,发布操作知道该文件,并将其放在不会影响我的开发站点的地方 - 即它不会't 位于我的开发站点的根目录中,使其始终处于离线状态.

This is cool and I really like the idea, but I want to create my own custom app_offline.htm file that the publish action is aware of and put it somewhere where it doesn't effect my development site - i.e. it doesn't sit in the root of my development site rendering it offline all the time.

来自对 Scott Gu 关于app_offline.htm,似乎无法在 VS 2005 中自定义 app_offline.htm 文件 - 这在 VS 2008 和现在的 VS 2010 中是否有所改变?

From the comments on Scott Gu's post about app_offline.htm, it seems that customization of the app_offline.htm file wasn't possible with VS 2005 - has this changed with VS 2008 and now VS 2010?

推荐答案

我知道这已经过时了,但是因为我在查看这里后找到了解决方案,所以我想我应该提供一个答案.VS 11 在此位置保存发布 app_offline.htm 文件:

I know this is old but since I found a solution after looking here I thought I should provide an answer. VS 11 holds the publishing app_offline.htm file in this location:

C:Users[user]AppDataRoamingMicrosoftVisualStudio11.0app_offline.htm

我已经对此进行了测试并对其进行了自定义,如果您更改此文件,它确实可以工作.当然,缺点是这是用于所有网络发布的文件.

I have tested this and customized it and it does work if you change this file. The down side, of course, is that this is the file used for all web publishing.

这篇关于发布期间自定义 app_offline.htm 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆