发布时如何使网络应用程序脱机? [英] How to take web app offline while publishing?

查看:30
本文介绍了发布时如何使网络应用程序脱机?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很多时候,当我在 VS13 中点击 Publish 时,我会编译网站,但在上传时我收到错误消息,说文件正忙.

Very often, when I hit Publish in VS13, I get the site to compile but when uploading I get the error saying that a file is busy.

正在更新文件 (MyAzureSitePrecompiledApp.config).
C:...v12.0WebMicrosoft.Web.Publishing.targets(4255,5):
错误 ERROR_FILE_IN_USE:Web 部署任务失败.
(文件PrecompiledApp.config"正在使用中.
了解更多信息:http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE.)

Updating file (MyAzureSitePrecompiledApp.config).
C:...v12.0WebMicrosoft.Web.Publishing.targets(4255,5):
Error ERROR_FILE_IN_USE: Web deployment task failed.
(The file 'PrecompiledApp.config' is in use.
Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE.)

当我点击提供的链接时,建议我应该启用 appOffline 规则.当然!",我心里想.但是如何?!我用谷歌搜索了它,只是为了在发布时应该替换网站的文件上得到一堆点击.但是,我没有得到有关如何解决我的小问题的信息.

When I follow the link provided, it's suggested that I should go for enabling the appOffline rule. "Sure!", I think to myself. But how?! I've googled it, only to get a bunch of hits on the file that's supposed to replace the site while publishing. However, I get no info on how to get rid of my little problem.

我用简单的方法从我的 Azure 网站下载了一个发布配置文件,现在我正在使用它(你知道,ALT+B+H).

I went the easy way and downloaded a publishing profile from my Azure web site and now I'm using it (you know, ALT+B+H).

现在我通过转到 Azure 门户并手动使站点脱机来解决该问题.然后我可以发布,然后我将网站上线.非常不切实际且非常乏味.

Right now I resolve the problem by going to the portal for Azure and manually take the site off-line. Then I can publish and after that I take the site on-line. Highly impractical and painfully tedious.

这是什么原因造成的,我该如何解决?

What is causing this and how do I kill it?

推荐答案

您实际上在发布配置文件 (.pubxml) 中对其进行了配置.只需像这样将元素添加到 PropertyGroup:

You actually configure it in the publishing profile (.pubxml). Just add the element to the PropertyGroup like this:

<PropertyGroup>
  <EnableMSDeployAppOffline>true</EnableMSDeployAppOffline>
  ...
</PropertyGroup>

MSDN 文档中的更多信息

这篇关于发布时如何使网络应用程序脱机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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