0

For my console app I have stored app.config in custom path for now

AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", "c:\path to config file");
ConfigurationManager.RefreshSection("appSettings");

I wonder how we can load app config XML from a String variable

//pseudo code
String configXML = "<my dynamic xml string>";
AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", configXML);//<=looking for something like this
3
  • 2
    That doesn't make sense to me, really. Why would you hard code settings? The whole purpose of all that settings/configuration stuff is so to not have it hard coded ... Commented Aug 23, 2024 at 7:10
  • Why use app config then? You are adding extra efforts/overheads. Just go for your own file system instead of app config. Commented Aug 23, 2024 at 8:06
  • I would suggest reading documentation cf. learn.microsoft.com/en-us/aspnet/core/fundamentals/… Commented Aug 23, 2024 at 8:07

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.