72

I am currently working on project using asp.net core v1.1, and in my appsettings.json I have:

"AppSettings": {
   "AzureConnectionKey": "***",
   "AzureContainerName": "**",
   "NumberOfTicks": 621355968000000000,
   "NumberOfMiliseconds": 10000,
   "SelectedPvInstalationIds": [ 13, 137, 126, 121, 68, 29 ],
   "MaxPvPower": 160,
   "MaxWindPower": 5745.35
},

I also have class that I use to store them:

public class AppSettings
{
    public string AzureConnectionKey { get; set; }
    public string AzureContainerName { get; set; }
    public long NumberOfTicks { get; set; }
    public long NumberOfMiliseconds { get; set; }
    public int[] SelectedPvInstalationIds { get; set; }
    public decimal MaxPvPower { get; set; }
    public decimal MaxWindPower { get; set; }
}

And DI enabled to use then in Startup.cs:

services.Configure<AppSettings>(Configuration.GetSection("AppSettings"));

Is there any way to change and save MaxPvPower and MaxWindPower from Controller?

I tried using

private readonly AppSettings _settings;

public HomeController(IOptions<AppSettings> settings)
{
    _settings = settings.Value;
}

[Authorize(Policy = "AdminPolicy")]
 public IActionResult UpdateSettings(decimal pv, decimal wind)
 {
    _settings.MaxPvPower = pv;
    _settings.MaxWindPower = wind;

    return Redirect("Settings");
 }

But it did nothing.

Siemko
  • 802
  • 1
  • 7
  • 15
  • It isn't clear what you mean by "change and save." Are you wanting the "save" 1. to update appsettings.json or 2. to save only its in-memory representation. – Shaun Luttin Jan 15 '17 at 17:52
  • 1
    Option number 1, Sir. What I managed to do was to move those two settings to another file - installationsettings.json, register them with reloadOnChange in Startup class and when updating - modifying the file, as @Ankit suggested earlier today. – Siemko Jan 15 '17 at 19:44
  • Siemko, so how did you update the json setting file? Did you use the Configuration framework or did you open the file to edit it? – Norcino Feb 11 '17 at 12:28
  • @Manuel: I open the file, modify it and then save. – Siemko Feb 12 '17 at 11:40
  • @Siemko, thanks that's the only way I found myself. It would be nicer to have in IOptions a method to save the changes. – Norcino Feb 12 '17 at 17:47
  • 1
    I like this, https://learn.microsoft.com/en-us/answers/questions/299791/saving-to-appsettingsjson.html however one would should think .. "do I really think I like external configuration changes in my app running under a service user" – Walter Verhoeven Nov 24 '21 at 09:38
  • this is the best I have found: https://github.com/Nongzhsh/Awesome.Net.WritableOptions/ – Fabio May 03 '22 at 21:15
  • 1
    @WalterVerhoeven it can apply to MAUI apps, where this feature would be useful. Agreed that for WebApps this is rather to be avoided. – alelom Jan 28 '23 at 20:06

15 Answers15

39

Basically you can set the values in IConfiguration like this:

IConfiguration configuration = ...
// ...
configuration["key"] = "value";

The issue there is that e.g. the JsonConfigurationProvider does not implement the saving of the configuration into the file. As you can see in the source it does not override the Set method of ConfigurationProvider. (see source)

You can create your own provider and implement the saving there. Here (Basic sample of Entity Framework custom provider) is an example how to do it.

Deilan
  • 4,740
  • 3
  • 39
  • 52
Mathias
  • 1,819
  • 4
  • 22
  • 34
22

Here is a relevant article from Microsoft regarding Configuration setup in .Net Core Apps:

Asp.Net Core Configuration

The page also has sample code which may also be helpful.

Update

I thought In-memory provider and binding to a POCO class might be of some use but does not work as OP expected.

The next option can be setting reloadOnChange parameter of AddJsonFile to true while adding the configuration file and manually parsing the JSON configuration file and making changes as intended.

    public class Startup
    {
        ...
        public Startup(IHostingEnvironment env)
        {
            var builder = new ConfigurationBuilder()
                .SetBasePath(env.ContentRootPath)
                .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
                .AddEnvironmentVariables();
            Configuration = builder.Build();
        }
        ...
    }

... reloadOnChange is only supported in ASP.NET Core 1.1 and higher.

Dmitry Pavlov
  • 30,789
  • 8
  • 97
  • 121
Ankit
  • 2,448
  • 3
  • 20
  • 33
  • Thank you @Ankit for your answer! This one works perfectly, but only in Startup class, I cannot access Configuration object from Controller to use it to change configuration files. And I need two variables that will act like global static and accessed by build-in dependency injection, but also changeable from controller. – Siemko Jan 15 '17 at 11:10
  • 1
    @Siemko ok, I think you can trying parsing the configuration file yourself and modify the values directly and keep `reloadOnChange` value to `true` in `startup.cs`. – Ankit Jan 15 '17 at 11:48
  • Thank you once again, that's something I wanted to avoid, but if there's no other way, I have to try that. – Siemko Jan 15 '17 at 12:17
  • @Siemko You can access the Configuration object anywhere by registering it with DI. Could that work? – juunas Jan 15 '17 at 12:27
  • @juunas it does, but sadly, I cannot update values. It seems, that I have to find another way of storing those settings. – Siemko Jan 15 '17 at 13:14
  • @Siemko , I have updated the answer. I was curious what was your final approach to this situation. If this has helped, could you accept this one as answer ;) – Ankit Jan 16 '17 at 05:38
  • @Ankit It was quite the same as you suggested. What I managed to do was to move those two settings to another file - installationsettings.json, register them with reloadOnChange in Startup class and when updating - modifying the file. Your answer was the closest to what I did, so I accept it. – Siemko Jan 16 '17 at 09:44
  • I tried it all, but is seems it saves only in Memory. Disk file wasn't changed – alerya Apr 26 '17 at 16:08
  • 1
    After many years, when this function is almost built in, setting values are persist only in memory. Changing values does not change values in the file... – JayDee Aug 02 '22 at 09:10
20

Update appsettings.json file in ASP.NET Core at runtime.

Take this sample appsettings.json file:

{
  Config: {
     IsConfig: false
  }
}

This is the code to update IsConfig property to true:

Main()
{
    AddOrUpdateAppSetting("Config:IsConfig", true);
}

public static void AddOrUpdateAppSetting<T>(string key, T value) 
{
    try 
    {
        var filePath = Path.Combine(AppContext.BaseDirectory, "appSettings.json");
        string json = File.ReadAllText(filePath);
        dynamic jsonObj = Newtonsoft.Json.JsonConvert.DeserializeObject(json);
                
        var sectionPath = key.Split(":")[0];

        if (!string.IsNullOrEmpty(sectionPath)) 
        {
            var keyPath = key.Split(":")[1];
            jsonObj[sectionPath][keyPath] = value;
        }
        else 
        {
            jsonObj[sectionPath] = value; // if no sectionpath just set the value
        }

        string output = Newtonsoft.Json.JsonConvert.SerializeObject(jsonObj, Newtonsoft.Json.Formatting.Indented);
        File.WriteAllText(filePath, output);
    }
    catch (ConfigurationErrorsException) 
    {
        Console.WriteLine("Error writing app settings");
    }
}
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Qamar Zaman
  • 2,521
  • 2
  • 10
  • 16
  • Although I liked this approach the code won't function if you have a key without ":". I'd suggest ... var splittedKey = key.Split(":"); var sectionPath = splittedKey[0]; if (!string.IsNullOrEmpty(sectionPath) && splittedKey.Length > 1) { var keyPath = splittedKey[1]; ... – Frank Hintsch Sep 29 '21 at 07:05
  • See [this answer](https://stackoverflow.com/a/60436834/3873799) that improves this code with multiple nested layers. – alelom Jan 28 '23 at 20:10
15

I took Qamar Zamans code (thank you) and modified it to allow for editing parameters which are more:than:one:layer:deep.

Hope it helps someone out, surprised that this isn't a library feature somewhere.

public static class SettingsHelpers
{
    public static void AddOrUpdateAppSetting<T>(string sectionPathKey, T value)
    {
        try
        {
            var filePath = Path.Combine(AppContext.BaseDirectory, "appsettings.json");
            string json = File.ReadAllText(filePath);
            dynamic jsonObj = Newtonsoft.Json.JsonConvert.DeserializeObject(json);

            SetValueRecursively(sectionPathKey, jsonObj, value);

            string output = Newtonsoft.Json.JsonConvert.SerializeObject(jsonObj, Newtonsoft.Json.Formatting.Indented);
            File.WriteAllText(filePath, output);

        }
        catch (Exception ex)
        {
            Console.WriteLine("Error writing app settings | {0}", ex.Message);
        }
    }

    private static void SetValueRecursively<T>(string sectionPathKey, dynamic jsonObj, T value)
    {
        // split the string at the first ':' character
        var remainingSections = sectionPathKey.Split(":", 2);

        var currentSection = remainingSections[0];
        if (remainingSections.Length > 1)
        {
            // continue with the procress, moving down the tree
            var nextSection = remainingSections[1];
            SetValueRecursively(nextSection, jsonObj[currentSection], value);
        }
        else
        {
            // we've got to the end of the tree, set the value
            jsonObj[currentSection] = value; 
        }
    }
Alex Horlock
  • 276
  • 2
  • 7
  • 2
    Thanks, Alex: I have a suggested improvement on this code: Add the following line just before the recursive call to prevent a NullRef exception in the case a section does not exist. jsonObj[currentSection] ??= new JObject(); – Henri Koelewijn Jun 17 '20 at 11:24
6

According to Qamar Zaman and Alex Horlock codes, I've changed it a little bit.

 public static class SettingsHelpers
 {
    public static void AddOrUpdateAppSetting<T>(T value, IWebHostEnvironment webHostEnvironment)
    {
        try
        {
            var settingFiles = new List<string> { "appsettings.json", $"appsettings.{webHostEnvironment.EnvironmentName}.json" };
            foreach (var item in settingFiles)
            {


                var filePath = Path.Combine(AppContext.BaseDirectory, item);
                string json = File.ReadAllText(filePath);
                dynamic jsonObj = Newtonsoft.Json.JsonConvert.DeserializeObject(json);

                SetValueRecursively(jsonObj, value);

                string output = Newtonsoft.Json.JsonConvert.SerializeObject(jsonObj, Newtonsoft.Json.Formatting.Indented);
                File.WriteAllText(filePath, output);
            }
        }
        catch (Exception ex)
        {
            throw new Exception($"Error writing app settings | {ex.Message}", ex);
        }
    }



    private static void SetValueRecursively<T>(dynamic jsonObj, T value)
    {
        var properties = value.GetType().GetProperties();
        foreach (var property in properties)
        {
            var currentValue = property.GetValue(value);
            if (property.PropertyType.IsPrimitive || property.PropertyType == typeof(string) || property.PropertyType == typeof(decimal))
            {
                if (currentValue == null) continue;
                try
                {
                    jsonObj[property.Name].Value = currentValue;

                }
                catch (RuntimeBinderException)
                {
                    jsonObj[property.Name] = new JValue(currentValue);


                }
                continue;
            }
            try
            {
                if (jsonObj[property.Name] == null)
                {
                    jsonObj[property.Name] = new JObject();
                }

            }
            catch (RuntimeBinderException)
            {
                jsonObj[property.Name] = new JObject(new JProperty(property.Name));

            }
            SetValueRecursively(jsonObj[property.Name], currentValue);
        }


    }
}
Mahdi Farhani
  • 964
  • 1
  • 9
  • 22
5
    public static void SetAppSettingValue(string key, string value, string appSettingsJsonFilePath = null)
    {
        if (appSettingsJsonFilePath == null)
        {
            appSettingsJsonFilePath = System.IO.Path.Combine(System.AppContext.BaseDirectory, "appsettings.json");
        }

        var json =   System.IO.File.ReadAllText(appSettingsJsonFilePath);
        dynamic jsonObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Newtonsoft.Json.Linq.JObject>(json);

        jsonObj[key] = value;

        string output = Newtonsoft.Json.JsonConvert.SerializeObject(jsonObj, Newtonsoft.Json.Formatting.Indented);

        System.IO.File.WriteAllText(appSettingsJsonFilePath, output);
    }
Alper Ebicoglu
  • 8,884
  • 1
  • 49
  • 55
3

I see most of the answers use Newtonsoft.Json package for updating the settings. If you need to update the settings that are one layer deep, you can go without Newtonsoft.Json and use System.Text.Json (built-in on .Net Core 3.0 and above) functionality. Here's a simple implementation:

public void UpdateAppSetting(string key, string value)
{
    var configJson = File.ReadAllText("appsettings.json");
    var config = JsonSerializer.Deserialize<Dictionary<string, object>>(configJson);
    config[key] = value;
    var updatedConfigJson = JsonSerializer.Serialize(config, new JsonSerializerOptions { WriteIndented = true });
    File.WriteAllText("appsettings.json", updatedConfigJson);
}
Mykhailo Seniutovych
  • 3,527
  • 4
  • 28
  • 50
  • perfect, nice and simple – Shane.A Jun 28 '22 at 03:44
  • This worked perfectly. Above all examples throw exception for System.Text.Json indexer viz. "best overloaded method match for 'System.Text.Json.JsonElement.this[int]' has some invalid arguments". – deathrace Jun 29 '23 at 10:58
0

Suppose appsettings.json has an eureka port, and want to change it dynamically in args (-p 5090). By doing this, can make change to the port easily for docker when creating many services.

  "eureka": {
  "client": {
    "serviceUrl": "http://10.0.0.101:8761/eureka/",
    "shouldRegisterWithEureka": true,
    "shouldFetchRegistry": false 
  },
  "instance": {
    "port": 5000
  }
}


   public class Startup
   {
    public static string port = "5000";
    public Startup(IConfiguration configuration)
    {
        configuration["eureka:instance:port"] = port;

        Configuration = configuration;
    }


    public static void Main(string[] args)
    {
        int port = 5000;
        if (args.Length>1)
        {
            if (int.TryParse(args[1], out port))
            {
                Startup.port = port.ToString();
            }

        }
     }
0

I'm using my own configuration section and my own strongly typed object. I'm always injecting IOptions with this strongly typed object. And I'm able to change configuration in runtime. Be very careful with scopes of objects. New configuration values are picked up by request scoped object. I'm using constructor injection.

Documentation on this is very unclear though .. I'm no sure if this is meant to be. Read this in-depth discussion

Mitja Gustin
  • 1,723
  • 13
  • 17
0

There is an esier answer to modify the appsettings.json at runtime.

Json File structure

var filePath = Path.Combine(System.AppContext.BaseDirectory, "appSettings.json");

string jsonString = System.IO.File.ReadAllText(filePath);

//use https://json2csharp.com/ to create the c# classes from your json
Root root = JsonSerializer.Deserialize<Root>(jsonString);

var dbtoadd = new Databas()
{
    Id = "myid",
    Name = "mynewdb",
    ConnectionString = ""
};

//add or change anything to this object like you do on any list
root.DatabaseSettings.Databases.Add(dbtoadd);

//serialize the new updated object to a string
string towrite = JsonSerializer.Serialize(root);

//overwrite the file and it wil contain the new data
System.IO.File.WriteAllText(filePath, towrite);
Poul Bak
  • 10,450
  • 5
  • 32
  • 57
Dani F
  • 11
  • 1
0

The way I address this issue is by adding an "override" property is stored in a memory cache. So for example, my application has a "CacheEnabled" setting in the "appSettings.json" file that determines whether or not data query results are cached or not. During application / db testing, it is sometimes desirable to set this property to "false".

Through an administrator menu, an Administrator can override the "CacheEnabled" setting. The logic that determines whether or not the Cache is enabled, first checks for the override. If it doesn't find an override value, then it uses the "appSettings.json" value.

This probably isn't a good solution for a lot of people given the extra infrastructure needed to implement it. However, my application already had a Caching Service as well as an Administrator menu, so it was pretty easy to implement.

0

In my project I'm work with Active Directory Settings this way:

//...
public class Startup
{
    public void ConfigureServices(IServicesCollection services)
    {
        //...
        services.Configure<Ldap>(opts=> {
            opts.Url = "example.com";
            opts.UseSsl = true;
            opts.Port = 111;
            opts.BindDn = "CN=nn,OU=nn,OU=nn,DC=nn,DC=nn";
            opts.BindCredentials = "nn";
            opts.SearchBase = "DC=nn,DC=nn";
            opts.SearchFilter = "(&(objectClass=User){0})";
            opts.AdminCn = "CN=nn,OU=nn,OU=nn,DC=nn,DC=nn";
            opts.SearchGroupBase = "OU=nn,DC=nn,DC=nn";
        });
        //...
    }
}

So, without using appsettings.json.


After that I can update this settings from controller:

//...
    [HttpPost("setActiveDirectorySettings")]
    public ActionResult<IOptions<Ldap>> SetActiveDirectorySettings(ActiveDirectorySettings clientActiveDirectorySettings)
    {
        LdapOptions.Value.Url = clientActiveDirectorySettings.Url;
        LdapOptions.Value.UseSsl = clientActiveDirectorySettings.UseSsl;
        LdapOptions.Value.Port = clientActiveDirectorySettings.Port;
        LdapOptions.Value.BindDn = clientActiveDirectorySettings.BindDn;
        LdapOptions.Value.BindCredentials = clientActiveDirectorySettings.BindCredentials;
        LdapOptions.Value.SearchBase = clientActiveDirectorySettings.SearchBase;
        LdapOptions.Value.SearchFilter = clientActiveDirectorySettings.SearchFilter;
        LdapOptions.Value.AdminCn = clientActiveDirectorySettings.AdminCn;
        LdapOptions.Value.SearchGroupBase = clientActiveDirectorySettings.SearchGroupBase;
        return Ok(LdapOptions.Value);
    }
//...

Looks like it works for me

  • Please provide additional details in your answer. As it's currently written, it's hard to understand your solution. – Community Sep 06 '21 at 08:17
0

It match different layer and different environment. And it use Newtonsoft.Json. Here the code.

/// <summary>
/// update appsettings.{environment}.json
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="key"></param>
/// <param name="value"></param>
/// <param name="environment"></param>
public static void Update<T>(string key, T value, string? environment = null)
{
    var filePath = Path.Combine(Directory.GetCurrentDirectory(), $"appSettings.{(string.IsNullOrEmpty(environment) ? "" : $"{environment}.")}json");
    string json = File.ReadAllText(filePath);
    dynamic jsonObj = Newtonsoft.Json.JsonConvert.DeserializeObject(json);

    var sectionPaths = key.Split(":").ToList();
    jsonObj = SetValue(jsonObj, sectionPaths, 0, value);

    string output = Newtonsoft.Json.JsonConvert.SerializeObject(jsonObj, Newtonsoft.Json.Formatting.Indented);
    File.WriteAllText(filePath, output);
}

private static dynamic SetValue<T>(dynamic jsonObj, List<string> sectionPaths, int index, T value)
{
    if (sectionPaths.Count > index)
    {
        jsonObj[sectionPaths[index]] = SetValue(jsonObj[sectionPaths[index]], sectionPaths, ++index, value);
    }
    else
    {
        jsonObj = value;
    }
    return jsonObj;
}
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 26 '23 at 00:14
0

Here is my solution where I use JObject to parse and update appsettings.json:

public static void UpdateAppSetting
(
    string key,
    string value,
    string environment = ""
)
{
    try
    {
        // I let the user provide the path with the double-dots for convenience.
        // Because any path has to passed to JObject with single dots
        key = key.Replace
        (
            ":",
            "."
        );

        // Get appsettings.json path according to the environment which can also be empty
        var filePath = Path.Combine
        (
            AppContext.BaseDirectory,
            environment.Any()
                ? $"appsettings.{environment}.json"
                : "appsettings.json"
        );

        // Read appsettings.json and parse it to a JObject
        string json = File.ReadAllText(filePath);
        var jObject = JObject.Parse(json);

        var keyParts = key.Split(".");

        // Get the path for the parent of the property we want to update
        var parentPath = key.Substring
        (
            0,
            key.LastIndexOf(".")
        );
        
        // Select the parent as JToken
        var parentToken = jObject.SelectToken(parentPath);

        // Along with the parent, now we pass the property we want to update and set the value
        parentToken[keyParts.Last()] = value;

        string output = JsonConvert.SerializeObject
        (
            jObject,
            Formatting.Indented
        );

        File.WriteAllText
        (
            filePath,
            output
        );
    }
    catch (Exception ex)
    {
        Console.WriteLine
        (
            "Error writing app settings | {0}",
            ex.Message
        );
    }
}

Usage:

Update simple property:

UpdateAppSetting
(
   "Parent:Property",
   "ValueToSet",
   Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")
)

Update nested property:

UpdateAppSetting
(
   "Parent:Child:Property",
   "ValueToSet",
   Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")
)

Update nested list property:

UpdateAppSetting
(
   "Parent:Child[1]:Property",
   "ValueToSet",
   Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")
)

Cheers.

-2

Based on @Alper Ebicoglu answer

GET:

// ===== || GET || GET appsettings.js property =====================================================================
[HttpGet]
[Route("GetNotificationDays")]
public async Task<IActionResult> GetNotificationDays()
{   
    
        var path = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "appsettings.json");
        var json = await System.IO.File.ReadAllTextAsync(path);
        dynamic jsonObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Newtonsoft.Json.Linq.JObject>(json);
        return StatusCode(200, new { daysBefore = (int)jsonObj.InvoicementNotificationSettings.DaysBefore});
}

Exp:

(int)jsonObj.InvoicementNotificationSettings.DaysBefore =

    (int) = cast to int - depending on the property
    
    jsonObj = appsettings.js,
    
    InvoicementNotificationSettings = object in appsettings.js,
    
    DaysBefore = property in InvoicementNotificationSettings

UPDATE: appsettings.js

 // ===== || PUT || UPDATE appsettings.js property =====================================================================
    [HttpPut]
    [Route("SetNotificationDays")]
    public async Task<IActionResult> SetNotificationDays(int notificationDays)
    {
        if (notificationDays != 0)
        {
                 var path = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "appsettings.json");
                 var json = await System.IO.File.ReadAllTextAsync(path);
                 dynamic jsonObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Newtonsoft.Json.Linq.JObject>(json);
                 jsonObj.InvoicementNotificationSettings.DaysBefore = notificationDays;
                 string output = Newtonsoft.Json.JsonConvert.SerializeObject(jsonObj, Newtonsoft.Json.Formatting.Indented);
                 await System.IO.File.WriteAllTextAsync(path, output);
                 return await GetNotificationDays();
        }
        return StatusCode(409);
    }

If reading appsettings from memmory: Ex: int daysBefore = configuration.GetValue<int>("InvoicementNotificationSettings:DaysBefore");

Than In Startup.js - to autoreload appsettings.js after updating

 public class Startup
    {
        public static IConfiguration Configuration { get; set; }

        // Constructor -----------------------------------------------------------------------------------------------------------------------------
        public Startup(IConfiguration configuration, Microsoft.Extensions.Hosting.IHostEnvironment env)
        {
            Configuration = configuration;

           // To autoreload appsettings.js after update -------------------------      
            var builder = new ConfigurationBuilder()
                .SetBasePath(env.ContentRootPath)
                .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
                .AddEnvironmentVariables();
                Configuration = builder.Build();
        }

appsettings.js

{
  "ConnectionStrings": {
    "DefaultConnection": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=ItlCrmsDb;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False"
  },
  "InvoicementNotificationSettings": {
    "DaysBefore": 4
  },
   
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft": "Warning",
      "Microsoft.Hosting.Lifetime": "Information"
    }
  },
  "AllowedHosts": "*"
}
Stefan27
  • 845
  • 8
  • 19