JetBrains Rider - setting appsettings overrides

I am trying to use JetBrains Rider for my existing .NET Core project. In a project, I have several overrides appsettings.json

:

  • appsettings.Development.json

    - for development
  • appsettings.Test.json

    - for testing
  • appsettings.Staging.json

    - for staging environment
  • and etc.

In Visual Studio, the overrides work fine and I always get the development override when I run the app in debug mode. However, in Rider, I am getting defaults appsettings.json

which are not good for debugging and development. How do I change the settings to get the values ​​from the correct override?

+3


source to share


2 answers


You need to set your environment variable ASPNETCORE_ENVIRONMENT

.

To do this, create separate configurations for each environment: enter image description here



Then click "Edit Configurations"

I create one for each env - and specify an environment variable as needed: enter image description here

+7


source


For Mac interface:



  • Select the configuration in which you want to change the environment

  • Select environment variables

  • Select "Development" or "Production"

+1


source







All Articles