使用 WebDeploy (MSDeploy) 部署到 Microsoft Azure 网站目标不起作用 [英] Using WebDeploy (MSDeploy) to deploy to a Microsoft Azure Website target doesn't work

查看:59
本文介绍了使用 WebDeploy (MSDeploy) 部署到 Microsoft Azure 网站目标不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过 Visual Studio 2015 的发布"功能将我的 Web 应用程序部署到 Azure 网站/应用程序服务暂存槽,但收到以下错误:

I'm trying to deploy my web app via Visual Studio 2015's "Publish" functionality to an Azure website/app service staging slot and I receive the following errors:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.targets(4295,5):警告:由于套接字错误,正在重试同步(10054) 发生.
正在对象站点清单 (sourcePath) 上重试操作序列化".尝试 10 个中的 1 个.正在更新文件 (xxxxxxxxxxxxx__staging\bin\EntityFramework.dll).C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.targets(4295,5):警告:由于发生套接字错误 (10054),正在重试同步.
正在对象站点清单 (sourcePath) 上重试操作序列化".尝试 10 次中的 2 次.C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.targets(4295,5):警告:由于发生套接字错误 (10054),正在重试同步.
正在对象站点清单 (sourcePath) 上重试操作序列化".尝试 10 次中的 3 次.C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.targets(4295,5):警告:由于发生套接字错误 (10054),正在重试同步.
正在对象站点清单 (sourcePath) 上重试操作序列化".尝试 10 次中的 4 次.C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.targets(4295,5):警告:由于发生套接字错误 (10054),正在重试同步.
正在对象站点清单 (sourcePath) 上重试操作序列化".尝试 10 次中的 5 次.正在更新文件 (xxxxxxxxxxxxx__staging\bin\EntityFramework.dll).C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.targets(4295,5):警告:由于发生套接字错误 (10054),正在重试同步.
正在对象站点清单 (sourcePath) 上重试操作序列化".尝试 10 次中的 6 次.正在更新文件 (xxxxxxxxxxxxx__staging\bin\EntityFramework.dll).C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.targets(4295,5):警告:由于发生套接字错误 (10054),正在重试同步.
正在对象站点清单 (sourcePath) 上重试操作序列化".尝试第 7 次,共 10 次.C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.targets(4295,5):警告:由于发生套接字错误 (10054),正在重试同步.
正在对象站点清单 (sourcePath) 上重试操作序列化".尝试第 8 次,共 10 次.C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.targets(4295,5):警告:由于发生套接字错误 (10054),正在重试同步.
正在对象站点清单 (sourcePath) 上重试操作序列化".尝试 10 次中的 9 次.C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.targets(4295,5):警告:由于发生套接字错误 (10054),正在重试同步.
正在对象站点清单 (sourcePath) 上重试操作序列化".尝试 10 个中的 10 个.C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.targets(4295,5):错误:Web 部署任务失败.(无法将数据写入传输连接:远程主机强行关闭了现有连接.)发布部署失败.

我几乎到处都在寻找解决方案.我试过重新创建一个暂存槽.我曾尝试在网络上搜索任何对错误消息任何部分的引用;但没有可用的解决方案.

I have searched literally everywhere for a solution. I have tried re-creating a staging slot. I have tried searching on the web for any reference to any part of the error messages; but no solutions are available.

我使用的是 Visual Studio 2015 Update 3.它是一个 .NET 4.5.1 网络应用.

I'm using Visual Studio 2015 Update 3. It's a .NET 4.5.1 web app.

在事件日志中还有另一条错误信息:错误代码:999 异常消息:无法将数据写入传输连接:远程主机强制关闭现有连接.异常堆栈跟踪:现有连接被远程主机强行关闭在 System.Net.Sockets.Socket.MultipleSend(BufferOffsetSize[] buffers, SocketFlags socketFlags)在 System.Net.Sockets.NetworkStream.MultipleWrite(BufferOffsetSize[] buffers)--- 内部异常堆栈跟踪结束 ---
无法将数据写入传输连接:远程主机强行关闭了现有连接.在 System.Net.ConnectStream.InternalWrite(Boolean async, Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)在 System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32 size)在 System.IO.BufferedStream.Flush()在 System.IO.BufferedStream.Dispose(Boolean disposing)在 System.IO.Stream.Close()在 System.IO.BinaryWriter.Dispose(Boolean disposing)在 System.IO.BinaryWriter.Close()在 Microsoft.Web.Deployment.PackageSerializer.Dispose()在 Microsoft.Web.Deployment.AgentClientProvider.RemoteDestSync(DeploymentObject sourceObject, DeploymentSyncContext syncContext, Nullable1 syncPass, String syncSessionId)在 Microsoft.Web.Deployment.DeploymentObject.SyncToInternal(DeploymentObject destObject, DeploymentSyncOptions syncOptions, PayloadTable payloadTable, ContentRootTable contentRootTable, Nullable1 syncPassId, String syncSessionId)在 Microsoft.Web.Deployment.DeploymentObject.SyncTo(DeploymentProviderOptions providerOptions, DeploymentBaseOptions baseOptions, DeploymentSyncOptions syncOptions)

In the event log there is also another error message: Error Code: 999 Exception Message: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host. Exception Stack Trace: An existing connection was forcibly closed by the remote host at System.Net.Sockets.Socket.MultipleSend(BufferOffsetSize[] buffers, SocketFlags socketFlags) at System.Net.Sockets.NetworkStream.MultipleWrite(BufferOffsetSize[] buffers) --- End of inner exception stack trace ---
Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host. at System.Net.ConnectStream.InternalWrite(Boolean async, Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state) at System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32 size) at System.IO.BufferedStream.Flush() at System.IO.BufferedStream.Dispose(Boolean disposing) at System.IO.Stream.Close() at System.IO.BinaryWriter.Dispose(Boolean disposing) at System.IO.BinaryWriter.Close() at Microsoft.Web.Deployment.PackageSerializer.Dispose() at Microsoft.Web.Deployment.AgentClientProvider.RemoteDestSync(DeploymentObject sourceObject, DeploymentSyncContext syncContext, Nullable1 syncPass, String syncSessionId) at Microsoft.Web.Deployment.DeploymentObject.SyncToInternal(DeploymentObject destObject, DeploymentSyncOptions syncOptions, PayloadTable payloadTable, ContentRootTable contentRootTable, Nullable1 syncPassId, String syncSessionId) at Microsoft.Web.Deployment.DeploymentObject.SyncTo(DeploymentProviderOptions providerOptions, DeploymentBaseOptions baseOptions, DeploymentSyncOptions syncOptions)

然而,我认为以上是一个红鲱鱼;我想这是一个问题:

However, I believe the above is a red herring; I would imagine it's a problem with:

正在对象站点清单 (sourcePath) 上重试操作序列化".

Retrying operation 'Serialization' on object sitemanifest (sourcePath).

似乎重试了 10 次,但失败了;这可能意味着打开的 MSDeploy 连接将关闭,从而导致第二次失败.

It appears this is retried 10 times with failure; this would probably mean the open MSDeploy connection would close, causing the second failure.

请注意,在发布向导中,我点击了验证连接"按钮,它出现了一个绿色的勾

推荐答案

Microsoft 几乎已经确认这是一个错误.不过,他们正在努力重现该问题.

Microsoft have pretty much confirmed it's a bug. They are struggling to reproduce the issue though.

解决方法是将新的应用程序设置放入 Azure 门户上的 Web 应用程序,名为 WEBSITE_WEBDEPLOY_USE_SCM 并将值设置为 false.然后部署工作正常.

The workaround is to put a new app setting into the Web app on the Azure Portal, called WEBSITE_WEBDEPLOY_USE_SCM and set the value to false. Deployment then works fine.

这篇关于使用 WebDeploy (MSDeploy) 部署到 Microsoft Azure 网站目标不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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