Where are environment variables stored and how to remove them

iKingNinja 60 Reputation points

Hello, I discovered it's possible to set environment variables using the

export key=value

command in the shell, but now I'm wondering: how can I remove an environment variable stored like this and where are they stored?

A set of technologies in the .NET Framework for building web applications and XML web services.
4,234 questions
0 comments No comments
{count} votes

Accepted answer
  1. Zhi Lv - MSFT 32,036 Reputation points Microsoft Vendor

    Hi @iKingNinja

    how can I remove an environment variable stored like this and where are they stored?

    You can refer to this article: Use multiple environments in ASP.NET Core
    In the local machine development: the environment can be set in the Properties\launchSettings.json file of the project. Environment values set in launchSettings.json override values set in the system environment.
    In the production environment: It depends on the production environment, for example, in windows server, you can set the ASPNETCORE_ENVIRONMENT environment variable with web.config. Then, in macOS, Machine-level environment variables are set in the .bashrc or .bash_profile file. Edit the file using any text editor.

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    Best regards,

    2 people found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful