I have hosted many ASP.NET and MVC applications before. I was playing with MVC6 lately and tried to host an MVC6 application.
Everything works fine if I host it as a new website. When I host it as an application under the default website of IIS, it only shows an empty page. Please find the log information below
warn: Microsoft.Extensions.DependencyInjection.DataProtectionServices[0] Neither user profile nor HKLM registry available. Using an ephemeral key repository. Protected data will be unavailable when application exits. warn: Microsoft.AspNet.DataProtection.Repositories.EphemeralXmlRepository[0] Using an in-memory repository. Keys will not be persisted to storage. Hosting environment: Production Now listening on: http://localhost:23000 Application started. Press Ctrl+C to shut down. info: Microsoft.AspNet.Hosting.Internal.HostingEngine[1] Request starting HTTP/1.1 GET http://localhost/MVC6 info: Microsoft.AspNet.Hosting.Internal.HostingEngine[2] Request finished in 0.0687ms 404
Note: Default website uses application pool asp.net4.5 and my MVC6 application uses it's own application pool as mentioned in http://docs.asp.net/en/latest/publishing/iis.html#iis-server-configuration
Anyone else faced similar problem like this? I want to know how to make it work under default website