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

UseIISIntegration should delay setting urls #242

Closed
Tratcher opened this issue Jul 27, 2016 · 3 comments
Closed

UseIISIntegration should delay setting urls #242

Tratcher opened this issue Jul 27, 2016 · 3 comments
Assignees
Milestone

Comments

@Tratcher
Copy link
Member

Today it's a common mistake for callers to reverse UseIISIntegration and UseUrls, breaking their app in IIS/Express and Azure.

Proposal, rather than having UseIISIntegration set the url immediately, set it later when Build is called (e.g. inside the ConfigureServices callback) or in the IStartupFilter via IServerAddressesFeature.

@halter73
Copy link
Member

Seems like a good idea. Today, you can check whether UseIISIntegration is activated in Program.Main() by checking whether whether the urls setting was changed after calling it. Technically, changing when we change the urls settings is breaking, but it probably won't affect too many apps.

It would be nice if there was still an easy workaround to figure out if the app is running behind IIS in Program.Main() after this change.

@Tratcher
Copy link
Member Author

What would you do in Main if you did detect IIS?

Checking for the environment variables directly may be better. Or we could provide an IsRunningInIIS API.

@halter73
Copy link
Member

To disable Kestrel connection filters that are replaced by IIS modules perhaps. Admittedly it's probably not common to use a single code base to deploy with and without IIS, so I don't think this would break (m)any people.

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

3 participants