Changing IHostingEnvironment.ApplicationName using ASPNETCORE_APPLICATIONNAME env variable #11085
Labels
affected-few
This issue impacts only small number of customers
area-hosting
Includes Hosting
area-networking
Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
enhancement
This issue represents an ask for new feature or an enhancement to an existing one
severity-minor
This label is used by an internal tool
Milestone
Currently it not possible to change IHostingEnvironment.ApplicationName property via environment variables.
Although the variable is correctly read in the WebHostBuilder class, it is overwritten in the UseStartup method.
https://github.com/aspnet/AspNetCore/blob/d24ec01224726fa85dc7683d0f70a94d9172bc94/src/Hosting/Hosting/src/WebHostBuilder.cs#L45
https://github.com/aspnet/AspNetCore/blob/d24ec01224726fa85dc7683d0f70a94d9172bc94/src/Hosting/Hosting/src/WebHostBuilderExtensions.cs#L75
Describe the solution you'd like
Maybe this fix in UseStartup method will solve the problem:
The text was updated successfully, but these errors were encountered: