ASP.NET 5 IIS on windows 10 HttpPlatformHandler Getting 404 Not found

别等时光非礼了梦想. 提交于 2019-12-11 11:17:31

问题


I have followed the documentation on the ASP.NET site to deploy an ASP.NET5 website on IIS, When I browse the site at http://localhost/mysite I get a 404 Not found:

HTTP/1.1 404 Not Found Content-Length: 0 Server: Kestrel X-Powered-By: ASP.NET Date: Wed, 03 Feb 2016 18:15:57 GMT

(from fiddler)

if I check Application Event logs I find an entry against HttpPlatformHandler:

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 '3896' started successfully and is listening on port '6277'.

If I browse http://localhost:6277 I find that the website is running fine.

So my guess is that the HttpPLatformHandler is not proxying the site correctly??

I am using DNX version 1.0.0-rc1-update1

Has anyone had this issue and been able to resolve it?


回答1:


I found the answer in another SO post here

It seems there is a bug with RC1 and the HttpPlatformHandler. See ASP.NET IIS Integration issue #14.

The issue is related to case when hosting our app in a sub-site in IIS meaning we have to tell ASP the path:

public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
    app.Map("/mysite", (myAppSite) => this.ConfigureMyAppPath(myAppSite, env));
}

public void ConfigureMyAppPath(IApplicationBuilder app, IHostingEnvironment env)
{
    // the actual Configure code
}


来源:https://stackoverflow.com/questions/35184997/asp-net-5-iis-on-windows-10-httpplatformhandler-getting-404-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!