ASP.NET 5 MVC 6 问题在 IIS 8 中托管应用程序
ASP.NET 5 MVC 6 Issues hosting application in IIS 8
我从 Visual studio 2015 年在文件系统中发布了 ASP.NET 5 MVC 6 应用程序,然后我将该代码复制到 IIS 服务器并按照 link.
我创建了一个网站,并按照上面的说明将其指向 wwwroot 文件夹 link。
当我浏览网站时,我在 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
。我还重新启动了服务器以查看是否可以解决问题。
正如@Ray 在上面的评论中承认的那样,解决方案是将 launchsettings.json 文件中的端口设置从端口 31581 修改为 80。
我从 Visual studio 2015 年在文件系统中发布了 ASP.NET 5 MVC 6 应用程序,然后我将该代码复制到 IIS 服务器并按照 link.
我创建了一个网站,并按照上面的说明将其指向 wwwroot 文件夹 link。
当我浏览网站时,我在 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
。我还重新启动了服务器以查看是否可以解决问题。
正如@Ray 在上面的评论中承认的那样,解决方案是将 launchsettings.json 文件中的端口设置从端口 31581 修改为 80。