是否可以将 Visual Studio 2012 配置为自动创建(和删除)app_offline.htm
使用 ftp 作为发布方法时的文件?
我尝试手动创建文件并将其添加到解决方案中(因此它会自动上传,一旦发布过程完成,我可以手动删除它)。
但是因为它存在于我的解决方案中,所以每个请求都被重定向到它,我无法调试任何东西。
将名称更改为 app_offline.htm.deactivated
在开发过程中将其改回 app_offline.htm
在发布之前似乎不是一个完美的解决方案。
如果 VS12 本身不支持这个,我很乐意使用任何可用的扩展。
编辑:我注意到,app_offline.htm
激活时创建文件 delete all content before publishing
但当未选择此选项时则不然。
插入 <EnableMSDeployAppOffline>true</EnableMSDeployAppOffline>
到 .pubxml
文件没有改变任何东西。
最佳答案
来自:http://www.asp.net/mvc/tutorials/deployment/visual-studio-web-deployment/deploying-a-code-update
它说:
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>
关于visual-studio-2012 - 通过 ftp 发布时是否可以使用 app_offline.htm?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23998623/