【问题标题】:ASP.NET 5 MVC 6 Issues hosting application in IIS 8ASP.NET 5 MVC 6 在 IIS 8 中托管应用程序的问题
【发布时间】:2016-01-13 18:05:49
【问题描述】:

我在 Visual Studio 2015 的文件系统中发布了 ASP.NET 5 MVC 6 应用程序,然后我将该代码复制到 IIS 服务器并根据此 link 进行相应配置。

我按照上面链接中的说明创建了一个网站并将其指向 wwwroot 文件夹。

当我浏览网站时,我在 IE 浏览器中得到 404。所以我所做的是我打开了登录 wwwroot 文件夹下的 web.config 文件。我将 stdoutLogEnabled 的值设置为 true stdoutLogEnabled="true"。然后我尝试再次在浏览器中浏览该网站。在日志文件夹中,我可以看到它正在侦听 31581 端口。但是当我浏览 IIS 中托管的 http://localhost/website_name 时,我得到 404。所以我查看了事件日志,我得到了与 HttpPlatformHandler 相关的错误。另请参阅下面的事件日志。

标准日志:

Hosting environment: Production
Now listening on: http://localhost:31581
Application started. Press Ctrl+C to shut down.

事件日志:

The description for Event ID 1001 from source HttpPlatformHandler cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event: 

Process '4784' started successfully and is listening on port '28688'.

这可能是一个已知问题吗?我看了几篇文章,他们说要卸载并重新安装HttpPlatformHandler。我还重新启动了服务器,看看是否能解决问题。

【问题讨论】:

  • 当您导航到 localhost:31581 时会发生什么?问题是绑定到端口 80,您在其中导航以浏览您的站点,而该站点托管在 31581 上,您可以在 IIS 中或通过配置进行更改
  • 我可以使用localhost:31581 浏览。我相信应用程序会在您通过 IIS 浏览网站时自动生成。
  • 您需要修改IIS中的绑定。也请查看属性文件夹中的 launchsettings.json 来配置 IIS Express 的端口号或您正在使用的配置
  • 在launchsettings.json 文件中更新端口绑定后,我能够浏览应用程序:)
  • @Ray 将其作为答案发布并接受。

标签: c# asp.net iis asp.net-core asp.net-core-mvc


【解决方案1】:

正如@Ray 在上面的评论中所承认的,解决方案是将launchsettings.json 文件中的端口设置从端口31581 修改为80。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-11-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多