Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/astordev/hosting-env-unprefixed-variable-repro
Minimal reproduction project for "Unprefixed Hosting Environment Variable is ignored"
https://github.com/astordev/hosting-env-unprefixed-variable-repro
Last synced: 9 days ago
JSON representation
Minimal reproduction project for "Unprefixed Hosting Environment Variable is ignored"
- Host: GitHub
- URL: https://github.com/astordev/hosting-env-unprefixed-variable-repro
- Owner: astorDev
- Created: 2024-04-26T09:28:37.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-04-26T10:02:43.000Z (7 months ago)
- Last Synced: 2024-04-27T10:38:20.326Z (7 months ago)
- Language: C#
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hosting-env-unprefixed-variable-repro
Minimal reproduction project for "Unprefixed Hosting Environment Variable is ignored"
# Recreating this example
1. Create a new web project
```sh
dotnet new web
```2. Run it setting "ENVIRONMENT" environment variable
```sh
export ENVIRONMENT=Repro && dotnet run
```3. Search the logs for `Hosting environment:`
|Expected|Actual|
|---|---|
|Hosting environment: Repro|Hosting environment: Development|## Note
I was leaning toward assuming that the variable is ignored since it's overridden by `launchSettings`. But first, deleting `launchSettings` doesn't make a difference in the problem (only changing Development to Production). And for other variables unprefixed variables take precedence over variables prefixed with `ASPNETCORE_`