dicej / spin-dotnet-sdk

Experimental Spin SDK for .NET
1 stars 4 forks source link

[samples/http-aspnetcore] changes to appsettings.json is not respected #17

Open bacongobbler opened 3 weeks ago

bacongobbler commented 3 weeks ago

One thing I'm noticing as I'm messing about with the ASP.NET Core sample is that changes to appsettings.json is not being respected by the runtime. I assume this has something to do with how the .NET runtime loads appsettings.json from the filesystem.

As a workaround, I found using InMemoryConfiguration works. I'm assuming other configuration libraries (e.g. Azure App Configuration) that are dependent on outbound HTTP could potentially work as well.

builder.Configuration.AddInMemoryCollection(new Dictionary<string, string?>
{
    ["Logging:LogLevel:Default"] = "Debug",
    ["Logging:LogLevel:Microsoft"] = "Warning",
    ["Logging:LogLevel:Microsoft.AspNetCore"] = "Information",
});