ASP.NET Core 项目在新笔记本电脑上挂在“构建”上

问题描述 投票:0回答:1

我一直在开发一个在 Docker 容器中运行的 ASP.NET 应用程序。拿到新笔记本电脑后,我安装了 Visual Studio 2022 和 Docker Desktop。我从 GitHub 克隆了我的项目,但是当我尝试构建该项目时,输出仅显示“Build Started at...”,无论我等待多久,都不会发生其他情况。我看到 Docker Desktop 中没有创建新容器,也没有错误消息。

我已确保我的 Docker 桌面设置与我的旧笔记本电脑上的设置相匹配。我还尝试直接从旧笔记本电脑复制解决方案文件夹,但问题仍然存在。

如何诊断构建过程陷入困境的位置?

到目前为止我已采取的步骤:

Installed the latest updates for Windows, Visual Studio, and Docker Desktop
Reinstalled Visual Studio
Reinstalled Docker Desktop
Checked Docker Desktop settings to ensure they match the old laptop
Copied the solution folder from my old laptop to the new one (same problem)

任何有关如何查明问题的建议将不胜感激。

asp.net model-view-controller build
1个回答
0
投票

我会发表评论,但我不能在那里放置图片,我认为这可能会有所帮助。

在 Visual Studio 中,当您有“启用 docker 的应用程序”(我假设您有,因为您已经在 docker 中运行它),它应该允许您直接从 Visual Studio 运行容器: enter image description here

如您所见,无需 Docker 即可直接在 PC 上启动 Web 应用程序(

https
http
选项)。

但是对于在 Docker 中运行应用程序,有一个特殊的选项 - 确保您拥有它并确保您已选择它。然后它应该按预期工作。

参考:带有 ASP.NET Core 的 Visual Studio 容器工具

© www.soinside.com 2019 - 2024. All rights reserved.