I have a react front end and c# backend app. I have a launchsettings.json file where i put some configuration. I want to add a string and read that in my c# app
I have tried adding something like the following in my launchsettings.json file:
"jsondata":
{
"value1": "value1data",
"value2": "value2data",
"value3": "value3data"
}
So in my C# code I have a value let's say value2, I want to be able to get the Json data and then filter out "value2" and then extract "value2data" to use in my app.
How can I do this in C#?
I have added Json string in the launchsettings.json file and able to read the values.
Program.cs:
Here is my
launchsettings.json
:var jsonData = Environment.GetEnvironmentVariable("jsondata");
able to get the values which is under EnvironmentVariable inside the launchsettings,json.