我想在GCP上部署使用ASP.NET 6.0创建的网站。该网站在localhost中完全正常,但当我尝试发布它时,在Visual Studio 2022输出中出现此错误:
Publishing MyProject to Compute Engine.
Failed to publish project MyProject .
我尝试了很多方法来解决这个问题,但还是找不到解决方法。以下是我采取的步骤:
1.在GoogleCompute Engine上,我在一台WindowsServer2016机器上创建了一个ASP.NET示例。
1.我已更改Windows密码并注意到:用户名和密码。
1.在Visual Studio 2022上,我安装了Google云工具。
1.在Google Cloud Tool上,我链接了用于Google Cloud的Google帐户。
1.在GoogleCloudTool上,我按下了"发布到GoogleCloud",然后按下了"计算引擎"。
1.我已经选择了正确的项目ID、正确的VM示例,并在步骤2中写入了正确的帐户用户名和密码。
1.我按了"发布"。
这是我的发现
- VS 2022的输出:**
Publishing MyProject to Compute Engine.
Failed to publish project MyProject.
问题是,我看不到有关部署失败原因的更多信息。
我也尝试过使用Visual Studio 2022的部署服务,但遇到了以下错误:
Build started...
1>------ Publish started: Project: MyProject, Configuration: Release Any CPU ------
MyProject-> C:\Users\MyProject\Desktop\MyProject\MyProject\MyProject\MyProject\bin\Release\net6.0\whatmain_support.dll
MyProject-> C:\Users\MyProject\Desktop\MyProject\MyProject\MyProject\MyProject\obj\Release\net6.0\PubTmp\Out\
C:\Program Files\dotnet\sdk\6.0.202\Sdks\Microsoft.NET.Sdk.Publish\targets\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(140,5): Error : Web deployment task failed. (Could not connect to the remote computer ("ip.ip.ip.ip") using the specified process ("Web Deployment Agent Service") because the server did not respond. Make sure that the process ("Web Deployment Agent Service") is started on the remote computer. Learn more at: https://go.microsoft.com/fwlink/?LinkId=221672#ERROR_COULD_NOT_CONNECT_TO_REMOTESVC.)
Could not connect to the remote computer ("ip.ip.ip.ip") using the specified process ("Web Deployment Agent Service") because the server did not respond. Make sure that the process ("Web Deployment Agent Service") is started on the remote computer. Learn more at: https://go.microsoft.com/fwlink/?LinkId=221672#ERROR_COULD_NOT_CONNECT_TO_REMOTESVC.
The remote server returned an error: (503) Server Unavailable.
Publish failed to deploy.
1>Build failed. Check the Output window for more details.
========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
1条答案
按热度按时间sq1bmfud1#
我也遇到了同样的问题,无法使用Google Cloud工具("Publish to Google Cloud"按钮)进行发布。
我使用普通的"发布"按钮。
您需要在VM示例中安装Web部署代理服务,并安装Web Deploy 3.5https://learn.microsoft.com/en-us/iis/install/installing-publishing-technologies/installing-and-configuring-web-deploy-on-iis-80-or-later
Create your publish profile: https://codelabs.developers.google.com/codelabs/cloud-compute-engine-aspnet#6
(to知道您站点名称远程访问您的VM示例〉IIS〉站点,并确保它确实是"默认网站")
就这样!应该可以了
Web部署任务失败。(无法使用指定的进程("Web部署代理服务")连接到远程计算机("###.###.###.###"),因为服务器未响应。请确保远程计算机上已启动该进程("Web部署代理服务")。有关详细信息,请访问:http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_COULD_NOT_CONNECT_TO_REMOTESVC.)
如果发生这种情况,本帖应该能帮到你。
Web deployment task failed. Could not connect...server did not respond
对我来说,这个错误发生了,这是因为我传递了我的主机名,而不是"默认网站",但这可以有所不同。
祝你好运!