首页 > 解决方案 > 无法从 Visual Studio for Mac 发布 Azure 函数

问题描述

我正在尝试从 Visual Studio for Mac(8.10.6,内部版本 10)发布我的 Azure Functions,但它不起作用。

运行时一切正常func start(显然从 Visual Studio 运行无法正常工作,因为我的 Macbook 具有 M1 处理器并且尚不支持)。

更重要的是,当我从模板创建新功能时,我可以正常发布它。我读过这可能是因为防病毒在机器上工作,但我希望如果我可以发布其他功能,那么它应该可以正常工作。

尝试从 Visual Studio 发布时,我得到:

/usr/local/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk.Publish/targets/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(140,5): error : Web deployment task failed. (Web Deploy experienced a connection problem with the server and had to terminate the connection.  Contact your server administrator if the problem persists.  Learn more at: https://go.microsoft.com/fwlink/?LinkId=221672#ERROR_CONNECTION_TERMINATED.)
/usr/local/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk.Publish/targets/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(140,5): error : 
/usr/local/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk.Publish/targets/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(140,5): error : Web Deploy experienced a connection problem with the server and had to terminate the connection.  Contact your server administrator if the problem persists.  Learn more at: https://go.microsoft.com/fwlink/?LinkId=221672#ERROR_CONNECTION_TERMINATED.
/usr/local/share/dotnet/sdk/5.0.302/Sdks/Microsoft.NET.Sdk.Publish/targets/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(140,5): error : Unexpected end of file has occurred. The following elements are not closed: results. Line 1, position 550.

你有什么想法为什么会这样?

标签: azurevisual-studioazure-functions

解决方案


听起来像是防火墙/访问问题,请检查 VS 是否受信任并有权连接到互联网

https://docs.microsoft.com/en-us/visualstudio/mac/install-behind-a-firewall-or-proxy-server?view=vsmac-2019


推荐阅读