ibe*_*dev 6 continuous-integration azure tfsbuild azure-devops asp.net-core
我在Visual Studio Online的Git中创建了一个虚拟的Hello World ASP.NET 5(MVC 6)项目.我按照本文档中描述的步骤构建并部署到我的Azure网站中.
我花了好几次尝试,因为构建失败了,例如"无法恢复NuGet包"或不存在的www文件夹(我必须提交源代码控制以使其工作),但我得到了它的工作,应用程序启动并运行.
我需要帮助的问题是持续集成配置.在Visual Studio中,只要在我的主分支中签入,我就选择了CI触发器来构建/部署.这会正确触发尝试,但它会因此错误而一直失败.
Error Code: ERROR_FILE_IN_USE
More Information: Web Deploy cannot modify the file 'AspNet.Loader.dll' on the destination because it is locked by an external process. In order to allow the publish operation to succeed, you may need to either restart your application to release the lock, or use the AppOffline rule handler for .Net applications on your next publish attempt.
如何解决这个问题呢?
谢谢.
PS:另外我不知道为什么在部署的Azure网站中我看不到日志.当我使用GitHub挂钩时,它用于显示所有失败/成功的部署.
通常在Azure应用程序>部署中的Azure中
我遇到了同样的问题。如果您有多个部署槽,可能有更优雅的方法来处理它,但对于我的情况,部署期间有一分钟的停机时间是可以接受的。
您可以修改脚本以使用 Start-AzureWebsite 和 Stop-AzureWebsite 注意:我添加了 $hostNameIndex,因为如果您添加域名,则需要更改它。然后,您可以将其传递到 Azure Powershell 脚本参数中。
参数($网站名称,$packOutput,$hostNameIndex = 1)
停止-AzureWebsite -名称 $websiteName
$website = Get-AzureWebsite -Name $websiteName
# 获取与 MSDeploy 一起使用的 scm url。
# 默认情况下,这将是数组中的第二个。添加自定义域名时会发生变化。
# 这里我有默认值和 2 个自定义值,所以 scm 位于第四个位置,即。指数:3
$msdeployurl = $website.EnabledHostNames[$hostNameIndex]
$publishProperties = @{'WebPublishMethod'='MSDeploy';
'MSDeployServiceUrl'=$msdeployurl;
'DeployIisAppPath'=$website.Name;
'用户名'=$website.PublishingUsername;
'密码'=$website.PublishingPassword}
$publishScript =“${env:ProgramFiles(x86)}\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\Publish\Scripts\default-publish.ps1”
。$publishScript -publishProperties $publishProperties -packOutput $packOutput
开始-AzureWebsite -名称 $websiteName
资源:
| 归档时间: |
|
| 查看次数: |
762 次 |
| 最近记录: |