Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running in IIS/Express now requires calling UseIISPlatformHandlerUrl() #139

Open
Tratcher opened this issue Jan 13, 2016 · 0 comments
Open

Comments

@Tratcher
Copy link
Member

When running a site behind HttpPlatformHandler it specifies the dynamic port to listen on via an environment variable. In RC1 Hosting would automatically consume this variable and reconfigure the server addresses. In RC2 this logic has moved to the IWebApplicationBuilder.UseIISPlatformHandlerUrl() extension in the Microsoft.AspNet.IISPlatformHandler package. This extension replaces server.urls in the configuration to avoid conflicts with self-host configurations.

Updated entry point code:

        public static void Main(string[] args)
        {
            var hostingConfiguration = WebApplicationConfiguration.GetDefault(args);
            var application = new WebApplicationBuilder()
                        .UseConfiguration(hostingConfiguration)
                        .UseIISPlatformHandlerUrl()
                        .UseStartup<Startup>()
                        .Build();
            application.Run();
        }

Without this extension IIS will fail to load the site as it cannot contact the back-end process. The console logs will report that the site has started on the default url http://localhost:5000/ or the self-host url specified in server.urls.

See: aspnet/IISIntegration#52

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

No branches or pull requests

1 participant