PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, August 22, 2022

[FIXED] Where are the EnvironmentVariablesConfigurationProvider fetching it's key-value pairs from?

 August 22, 2022     .net, .net-core, asp.net-core, c#, environment-variables     No comments   

Issue

Background

I am working on an asp.net core application which uses Environment Variables to store connection strings to the database. I tried changing the connection string in windows to connect the application to another database, but the application still uses the old connection string. I even removed the connection string completely but the old one is still present while debugging. This screenshot shows that the EnvironmentVariablesConfigurationsProvider inside the Configuration variable still holds the old value on runtime (index 24, AzureConnectionString):

enter image description here

This screenshot shows the environment variables that I have set-up in Windows:

enter image description here

Question

As you can see when comparing both pictures, the AzureConnectionString key is not defined in the Environment Variables dialog in Windows, but somehow present in the application on runtime, which makes me think that these values are fetched elsewhere.

So to the question. Where are the EnvironmentVariablesConfigurationProvider fetching it's key-value pairs from?


Solution

It seems the Environment Variables in the application is in fact built from the values seen in the Environment Variables dialog in windows. However there is also some kind of caching of said variables which I solved with a system reboot.



Answered By - wenzzzel
Answer Checked By - Terry (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

1,209,984

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © 2025 PHPFixing