Skip to content
This repository was archived by the owner on Nov 1, 2018. It is now read-only.

Add UseIISPlatformHandler extension method to IWebApplicationBuilder #52

Closed
davidfowl opened this issue Jan 7, 2016 · 6 comments
Closed
Assignees
Milestone

Comments

@davidfowl
Copy link
Member

See aspnet/Hosting#553. Here's what the entry point would look like:

using System.IO;
using Microsoft.AspNet.Hosting;

namespace HelloMvc
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var hostingConfiguration = WebApplicationConfiguration.GetDefault(args);

            var application = new WebApplicationBuilder()
                        .UseApplicationBasePath(Directory.GetCurrentDirectory())
                        .UseServerFactory("Microsoft.AspNet.Server.Kestrel")
                        .UseConfiguration(hostingConfiguration)
                        .UseUrls("http://localhost:5000")
                        .UseIISPlatformHandler()
                        .UseStartup<Startup>()
                        .Build();

            application.Run();
        }
    }
}

UseIISPlatformHandler sets the appropriate server.urls entry for the port and base path. These are baked into hosting today.

@glennc glennc added this to the 1.0.0-rc2 milestone Jan 7, 2016
@glennc
Copy link
Member

glennc commented Jan 7, 2016

I assume this is part of the outcome from yesterdays hours of discussion?

@davidfowl
Copy link
Member Author

Yap

@Tratcher
Copy link
Member

Tratcher commented Jan 7, 2016

If you call it UseIISPlatformHandler for both IWebApplicationBuilder and IApplicationBuilder it's going to be very confusing to document. How about UseIISPlatformHandlerUrl?

@guardrex
Copy link
Contributor

@Tratcher Is it safe to remain on a current runtime (-rc2-16357 at MyGet nightly) for this change with Hosting package(s) declared -rc2-*? In addition to the extension in Main, what needs to be done on the runtime/packaging dependencies side (if anything)?

@Tratcher
Copy link
Member

Microsoft.AspNet.Hosting rc2-16219 and later. Microsoft.AspNet.IISIntegration rc2-16132 and later. You'll need to update both packages at the same time as there is a conflict between the new and old behavior.
It's hard to say what build of DNX works with specific versions of other packages without testing.

@guardrex
Copy link
Contributor

@Tratcher Thx. Apparently I've been ok with runtime dnx-coreclr-win-x64.1.0.0-rc2-16343, but I'll upgrade that later today. I've always had my packages set to -rc2-*, so I'm 🍰 on that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants