Skip to content
This repository was archived by the owner on Nov 1, 2018. It is now read-only.
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

Description

@davidfowl

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions