'JetBrains Rider - configure appsettings overrides
I am trying JetBrains Rider for my existing .NET Core project. In the project I have several appsettings.json
overrides:
appsettings.Development.json
- for developmentappsettings.Test.json
- for testingappsettings.Staging.json
- for staging environment- etc.
In Visual Studio, the overrides work perfectly and I always get my Development override, when running the app in debug mode. However, in Rider I am getting the default appsettings.json
values, which are not suitable for debugging and development. How do I change the settings to get the values from the correct override?
Solution 1:[1]
You'll need to set the ASPNETCORE_ENVIRONMENT
environment variable.
To do this, create separate configurations for each environment:
Then click Edit Configurations
I create one for each env - and specify the Environment variable as appropriate:
Solution 2:[2]
For the Mac interface:
Solution 3:[3]
The accepted answer didn't work for me. I had to enter the environment variable ASPNETCORE_ENVIRONMENT=Development
in to the "Runtime arguments" field:
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Alex |
Solution 2 | grg |
Solution 3 | Tom |