Skip to content

Conversation

@kgday
Copy link

@kgday kgday commented Dec 3, 2023

Ability to add dotnet user secrets json configuration in the configuration builder.

OptionalFiles : ConfigFile list
InMemory : Map<string, string> }
InMemory : Map<string, string>
AddUserSecrets: bool}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a space here to separate the type from the bracket.


bldr.AddCommandLine(args) |> ignore

if conf.AddUserSecrets then
Copy link
Member

@pimbrouwers pimbrouwers Dec 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should appear before env vars, I try to match the prior specified here: https://learn.microsoft.com/en-us/dotnet/core/extensions/configuration.

image

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Goido. I'll fix that.

{ conf with OptionalFiles = (JsonFile filePath) :: conf.OptionalFiles }

///Adds optional user secrets to the ConfigurationBuilder.
[<CustomOperation("optional_user_secrets")>]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the non-optional brother of this omitted on purpose?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes because it is generally only used in the Development environment. In the default web builder of the c# template where it sets up all the config for you it only adds optional user secrets if the env is development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants