Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

tye ignores ASPNETCORE_ENVIRONMENT? #1585

Open
iammukeshm opened this issue May 4, 2023 · 3 comments
Open

tye ignores ASPNETCORE_ENVIRONMENT? #1585

iammukeshm opened this issue May 4, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@iammukeshm
Copy link

Describe the bug

A clear and concise description of what the bug is.

tye always ignores the ASPNETCORE_ENVIRONMENT variable and selects the DOTNET_ENVIRONMENT instead.

To Reproduce

env:
      - name: ASPNETCORE_ENVIRONMENT
        value: docker

But here is what I get.

chrome_nNn2oVbet2

@iammukeshm iammukeshm added the bug Something isn't working label May 4, 2023
@thijsk
Copy link

thijsk commented Jun 12, 2023

We are seeing similar behaviour;
When upgrading an ASP.NET 6.0 application to 7.0 we see that setting ASPNETCORE_ENVIRONMENT from tye.yaml no longer works, but setting DOTNET_ENVIRONMENT does work as expected.
Unclear if this is a bug in Tye or a change in .Net 7

@thijsk
Copy link

thijsk commented Jun 12, 2023

It is a breaking change in .NET 7.
The environment variable precedence has changed: https://learn.microsoft.com/en-us/dotnet/core/compatibility/aspnet-core/7.0/environment-variable-precedence

And since tye sets both by default

["DOTNET_ENVIRONMENT"] = "Development",

you'll have to specify DOTNET_ENVIRONMENT in your configuration instead of ASPNETCORE_ENVIRONMENT

@scarletquasar-snyder
Copy link

Looks like a real change in the environment variable name in .NET

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants