问题描述
很多时候,当我在 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.)
当我点击提供的链接时,建议我应该启用 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 网站下载了一个发布配置文件,现在我正在使用它(你知道,++).
I went the easy way and downloaded a publishing profile from my Azure web site and now I'm using it (you know, ++).
现在我通过转到 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>
这篇关于如何在发布时使 Web 应用程序脱机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!