Application.Configuration.Settings - How to use?

0
0

Hello,

I’ve added some custom settings into the file default.json. However Application.Configuration.Settings is null after the application loads?  Would it be possible to get a sample application that shows this working?

The default.json that I am attempting to create with is attached.  With my settings redacted.

 

Tim

Attachment
  • You must to post comments
0
0

Hi Tim,

accessing the single values is as easy as this

var Settings = Application.Configuration.Settings;
var CallBackPath = Settings.AzureAd.CallbackPath;
var Scopes = Settings.DownstreamApi.Scopes;

AlertBox.Show("CallBackPath=" + CallBackPath + " Scopes=" + Scopes);

Best regards
Frank

  • Tim
    • Tim
    • Apr 11, 2024 - 6:07 pm
    Cool, that is easy. Thanks. Too bad the settings are not there until after the application starts.
  • You must to post comments
0
0

Hi Tim,

it worked for me okay using your default.json and just changing the startup parameter.
Find sample attached.

Regards
Frank

  • Tim
    • Tim
    • Apr 11, 2024 - 3:55 pm
    Ok, I may not be able use these settings as I need them to be populated for authenticaion scaffolding. The Application.Configuration object is null until after App.Run is called. As a side question, is there an single line non awkward way to access the settings? I’m new to dynamic objects so I’m guessing that I’d need to access settings awkwardly or map the dynamic object to another object.
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.