C
C#2mo ago
Brady Kelly

✅ Read `launchsettings.json` environment variable from a terminal script in Rider

It looks like the only way to get Rider to reload real environment variable values is to restart the IDE. This is a pain when I'm debugging or experimenting with values that change often, so I figure a way around this is to update the 'fake' environment variable in launchsettings.json, then run a script in the IDE terminal to read that value and set the real environment variable in the OS (Windows for now). That way I know my app is getting an up to date value from the OS variable. I'm just stuck on how to read the launchSetting.json variable from a terminal script (PowerShell).
5 Replies
Angius
Angius2mo ago
$powershell
Angius
Angius2mo ago
Pwsh has access to everything .NET, so wouldn't surprise me if you were able to just use STJ
jcotton42
jcotton422mo ago
ConvertFrom/To-Json No need to directly use STJ
Angius
Angius2mo ago
Even better
Want results from more Discord servers?
Add your server
More Posts