2016-01-13 87 views
0

我在Visual Studio 2015的文件系統中發佈了ASP.NET 5 MVC 6應用程序,然後將該代碼複製到IIS服務器並根據此link進行相應配置。ASP.NET 5 MVC 6在IIS 8中託管應用程序的問題

我創建了一個網站,並按照上述鏈接中的說明將其指向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。我也重啓了服務器,看看是否解決了這個問題。

+0

發生了什麼端口設置://本地主機:31581?這個問題綁定到80端口,瀏覽您的站點,而站點託管在31581上,您可以在IIS中或通過配置更改該端口。 – lazy

+0

我可以使用'localhost:31581'瀏覽。我相信當您通過IIS瀏覽網站時,應用程序會自動生成該文件。 – Ray

+1

您需要修改IIS中的綁定。另請查看properties文件夾中的launchsettings.json以配置IIS Express的端口號或您正在使用的配置 – lazy

回答

2

正如@Ray上述評論承認,解決辦法是,當你導航到http修改從端口31581的launchsettings.json文件80