ASP.NET 5 MVC 6在IIS 8中托管应用程序的问题

时间:2016-01-13 18:05:50

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

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

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

当我浏览网站时,我在IE浏览器中获得404。所以我做的是打开登录www.ot文件夹下的web.config文件。我将stdoutLogEnabled的值设置为true stdoutLogEnabled="true"。然后我尝试再次浏览浏览器中的网站。在logs文件夹中,我可以看到它正在侦听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。我还重新启动了服务器以查看是否能解决问题。

1 个答案:

答案 0 :(得分:2)

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