John
John

Reputation: 1764

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

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?

Upvotes: 1

Views: 2036

Answers (1)

John
John

Reputation: 1764

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
}

Upvotes: 6

Related Questions