gpt4 book ai didi

c# - Web Api Core 在 Visual Studio 2017 中的 IIS Express 上启动时挂起?

转载 作者:太空狗 更新时间:2023-10-29 20:09:28 25 4
gpt4 key购买 nike

我刚刚将 Visual Studio 更新到 2017 的最终版本。
我正在从事 WebApi 核心项目。

VS2017-WebApi

每当我使用 IIS Express 启动它时,Google Chrome 就会出现并继续加载到下一页而没有任何响应

VS2017-WebApi-Chrome

这是怎么回事?
The problem on github

最佳答案

在 WebApi 核心上启用 IISExpress:

1. 启用 IISIntegration 组件:
安装 Microsoft.AspNetCore.Server.IISIntegration 包。

2. 编辑项目根目录下的Program.cs:

 var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration() // Add this line
.UseStartup<Startup>()
.Build();

关于c# - Web Api Core 在 Visual Studio 2017 中的 IIS Express 上启动时挂起?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42758165/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com