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

WebHostOptions can't be set from HostingStartup activated assemblies #5895

Closed
Tratcher opened this issue Apr 27, 2017 · 5 comments
Closed

WebHostOptions can't be set from HostingStartup activated assemblies #5895

Tratcher opened this issue Apr 27, 2017 · 5 comments
Labels
area-hosting Includes Hosting area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions Needs: Design This issue requires design work before implementating.
Milestone

Comments

@Tratcher
Copy link
Member

WebHostBuilder.Build->BuildCommonServices first creates a new WebHostOptions and reads all of the settings from config. Then it processes HostingStartup assemblies. Because config has already been read, the HostingStartup actions cannot modify any WebHostOptions options like CaptureStartupErrors. Configuring IWebHostBuilder from a HostingStartup assembly will not be equivalent to configuring it in Program.Main if these options cannot be set.

PreferHostingUrls had a similar problem when trying to run in ConfigureServices, so we removed it from WebHostOptions: aspnet/Hosting@a64940a

We've enabled IISIntegration to be auto-injected as a HostingStartup assembly, but it needs to set CaptureStartupErrors.

@Tratcher Tratcher changed the title WebHostOptions can't be set from HostingStart activated assemblies WebHostOptions can't be set from HostingStartup activated assemblies Apr 27, 2017
@Tratcher
Copy link
Member Author

@davidfowl @JunTaoLuo

@muratg
Copy link
Contributor

muratg commented Jun 26, 2017

Related: aspnet/Hosting#1042

@muratg
Copy link
Contributor

muratg commented Aug 8, 2017

@davidfowl please take a look while investigating #1042.

@muratg
Copy link
Contributor

muratg commented Nov 7, 2017

cc @glennc

@davidfowl davidfowl removed their assignment Feb 7, 2018
@aspnet-hello aspnet-hello transferred this issue from aspnet/Hosting Dec 18, 2018
@aspnet-hello aspnet-hello added this to the Backlog milestone Dec 18, 2018
@aspnet-hello aspnet-hello added area-hosting Needs: Design This issue requires design work before implementating. labels Dec 18, 2018
@Tratcher
Copy link
Member Author

Tratcher commented Nov 9, 2020

Closing. We'll need to redesign IHostingStartup for generic host and can re-consider there. dotnet/runtime#36394

@Tratcher Tratcher closed this as completed Nov 9, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 10, 2020
@amcasey amcasey added the area-hosting Includes Hosting label Jun 1, 2023
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-hosting Includes Hosting area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions Needs: Design This issue requires design work before implementating.
Projects
None yet
Development

No branches or pull requests

6 participants