API
,检查启用Docker支持(操作系统:Linux)
和无身份验证
。这样可以很好地生成项目模板以及带有docker compose文件的Docker项目。它可以成功构建并拉取所有所需的映像,但是,当我尝试从Visual Studio中运行它时,似乎不起作用,在日志中我看到如下所示内容:
Content root path: /app
Now listening on: http://[::]:80
...
Request starting HTTP/1.1 GET http://localhost:32778/
Microsoft.AspNetCore.Hosting.Internal.WebHost:Information: Request starting HTTP/1.1 GET http://localhost:32778/
但是!Docker日志显示发出了请求:Could not get any response There was an error connecting to http://localhost:32778/api/values.
我错过了什么?如果我使用IIS Express运行默认项目,则一切正常。编辑:我刚刚在ASP.NET Core 2.0上测试了这个问题,一切都正常。Microsoft.AspNetCore.Hosting.Internal.WebHost:Information: Request starting HTTP/1.1 GET http://localhost:32778/api/values
[40m[32minfo[39m[22m[49m: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] Request starting HTTP/1.1 GET http://localhost:32778/api/values
[40m[32minfo[39m[22m[49m: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] Request finished in 14.4873ms 307 Microsoft.AspNetCore.Hosting.Internal.WebHost:Information: Request finished in 14.4873ms 307