Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LaunchSettings.json missing in VS2019

VS2019 web project 4.7.1 framework

Till Visual studio 2017, there was a file to store Environment variables "launchsettings.json"

using c# environment.GetEnvironmentVariable("Name of variable") we can read environment variable values,

Recently I created a new project in VS2019 and there is no file by default as "launchsettings.json" and when I added JSON file manually c# code is not able to read those environment variables

Does anybody know where to store environment variables in VS2019?

like image 343
ParikshitSehgal Avatar asked Oct 16 '25 02:10

ParikshitSehgal


1 Answers

You have 2 ways to access the environment variable section.

You can add/change them through launchsettings.json.

enter image description here

Or you can right-click on the project and select Properties. Then you go under Debug tab and you will be able to change them.

enter image description here

like image 115
billybob Avatar answered Oct 19 '25 12:10

billybob



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!