Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restart command does not reload environment variables #123

Open
TheBlubb14 opened this issue Nov 26, 2023 · 0 comments
Open

Restart command does not reload environment variables #123

TheBlubb14 opened this issue Nov 26, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@TheBlubb14
Copy link

Describe the bug
When executing the restart command in visual studio from File -> Restart -> Restart then the environment variables from my windows 10 machine are not reloaded/updated.
If I start visual studio, then change some environment variables I can not read the updated values. This is fine as i can use the restart command to restart visual studio to load the updated environment values. But I will still get the old values from when I inital started visual studio.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new .Net 8 console project.
  2. Paste the following code
Console.WriteLine($"Hello {Environment.GetEnvironmentVariable("TWEAKSTER")}");
  1. Run the application. It should print Hello
  2. Leave visual studio open and create a new a new environment variable with the following powershell command
[Environment]::SetEnvironmentVariable('TWEAKSTER', 'world', 'User')
  1. Run the application. It should again print Hello
  2. Click on the restart command in visual studio from File -> Restart -> Restart
  3. Run the application. It prints Hello. But expected is Hello world
  4. Close visual studio manually and open it again.
  5. Now the application will print Hello world
  6. You can remove the environment variable again with
[Environment]::SetEnvironmentVariable('TWEAKSTER', $null, 'User')

Expected behavior
The environment variables should be reloaded if the restart command is executed.

@TheBlubb14 TheBlubb14 added the bug Something isn't working label Nov 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant