From e7f806014c506d01523b806afb4ba94a2e486ac0 Mon Sep 17 00:00:00 2001 From: Pim Brouwers Date: Thu, 16 Nov 2023 16:18:41 -0500 Subject: [PATCH] 4.0.5 --- CHANGELOG.md | 4 +++- src/Falco/ConfigBuilder.fs | 10 +++++----- src/Falco/Falco.fsproj | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c867c21..4615179 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,9 @@ All notable changes to this project will be documented in this file. -## [Unreleased] +## [4.0.5] - 2023-11-16 + +- Execution order of configuration builder (i.e., `configuration { add_env }`) set to match [default](https://learn.microsoft.com/en-us/dotnet/core/extensions/configuration#alternative-hosting-approach) configuration behaviour. ## [4.0.4] - 2023-03-13 diff --git a/src/Falco/ConfigBuilder.fs b/src/Falco/ConfigBuilder.fs index 128d4ce..ab7757e 100644 --- a/src/Falco/ConfigBuilder.fs +++ b/src/Falco/ConfigBuilder.fs @@ -29,11 +29,6 @@ type ConfigBuilder (args : string[]) = member _.Run(conf : ConfigBuilderSpec) = let mutable bldr = ConfigurationBuilder().SetBasePath(conf.BasePath) - bldr.AddCommandLine(args) |> ignore - - if conf.AddEnvVars then - bldr.AddEnvironmentVariables() |> ignore - for file in conf.RequiredFiles do match file with | IniFile file -> bldr.AddIniFile(file, optional = false, reloadOnChange = true) @@ -51,6 +46,11 @@ type ConfigBuilder (args : string[]) = if conf.InMemory.Keys.Count > 0 then bldr.AddInMemoryCollection(conf.InMemory) |> ignore + if conf.AddEnvVars then + bldr.AddEnvironmentVariables() |> ignore + + bldr.AddCommandLine(args) |> ignore + bldr.Build() :> IConfiguration /// Sets the base path of the ConfigurationBuilder. diff --git a/src/Falco/Falco.fsproj b/src/Falco/Falco.fsproj index 4fbdee1..c614593 100644 --- a/src/Falco/Falco.fsproj +++ b/src/Falco/Falco.fsproj @@ -1,7 +1,7 @@ Falco - 4.0.4 + 4.0.5 A functional-first toolkit for building brilliant ASP.NET Core applications using F#.