-
Notifications
You must be signed in to change notification settings - Fork 311
Using a custom "ApplicationName" and UseStartup<Startup>() doesn't work #1179
Comments
PS: If it's a bug and it will be resolved, it would be great if I could still set the application name BEFORE the call to UseStartup. |
This must indeed be a bug, unless Since |
Having an application name that is not an assembly name would definitely be nice. E.g. our assemblies have a naming convention of But of course, I can easily work around this by not using IHostingEnvironment.ApplicationName and getting this information from somewhere else. |
This is by design. The application name was an unfortunate choice as a property name (in hindsight) but it's too late to change that now. |
OK, thanks David! |
You could solve it by doing something like this; dev...khellang:fix-application-name |
Would you take a PR for that, @davidfowl? |
Basically, instead of checking if This means that In combination with #1178, I think this would be really nice. |
Seems like a lot of work for extremely little value. It also doesn't fix the fact that MVC uses it as the still uses it as the entry point. The fact is |
Work? As in runtime work? Or just coding-wise? At runtime, it's pretty much no work at all, and the coding is already done 😉 |
If this won't be changed, maybe the docs should be fixed here: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/hosting?tabs=aspnetcore2x#host-configuration-values It doesn't really say that you shouldn't touch this property. |
Related aspnet/Mvc#6685. |
If this was merged, MVC could use EDIT: That would have to be exposed through |
I was trying to set my own
IHostingEnvironment.ApplicationName
on my WebHostBuilder. However, if I set it before I useUseStartup
, it will be overwritten and the output isHello from 'AppName'!
:So I thought I'm smart and just call
UseSetting
afterUseStartup
but this results in the following exception:Is this a feature (meaning, custom application names can not be used with Startup-types) or a bug?
The text was updated successfully, but these errors were encountered: