0

I have a file, application.conf, that contains this code:

...
features{
    dev{
        features = ["feature1","feature2", "feature4"]
    }
}
...

How can I access that list of features from a C# file? I need to somehow import the .conf file into the C# file but can't find any way to do it.

Matt123
  • 556
  • 3
  • 15
  • 36
  • Does this answer your question https://stackoverflow.com/questions/1189364/reading-settings-from-app-config-or-web-config-in-net – TJacken Jul 29 '20 at 19:52
  • @Anve No, that looks like its for XML. As you can see in my code sample, it is not XML format. – Matt123 Jul 29 '20 at 20:22
  • what kind is your project web application or console? – TJacken Jul 29 '20 at 20:28
  • @Anve web application – Matt123 Jul 29 '20 at 20:34
  • I suppose that you do project in ASP.NET Core, then you can get config values by using IConfiguration interface, here you have example with json app.config file. https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-3.1 – TJacken Jul 29 '20 at 20:41

0 Answers0