vendredi 1 novembre 2019

Reading a setting file on server

I am writing a web service which currently needs to read some settings from a json file on server.

string allSettingsTxt = File.ReadAllText(settingsPath); List list = JsonConvert.DeserializeObject(allSettingsTxt);

I tried giving following for the path string settingPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"..\MyCurrentDir\setting.json");

But this path wont resolve on the actual deployment, I believe it has to be something like http://servername/settings/setting.json ??

  1. Where can I store such json file
  2. what path I should use to access it?



Aucun commentaire:

Enregistrer un commentaire