Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Can't add .env for ini config #505

Description

@stephentoub

(Ported from @atrauzzi at https://github.com/dotnet/corefx/issues/11317)

If I use the following:

            var configuration = new ConfigurationBuilder()
                .SetBasePath(Directory.GetCurrentDirectory())
                .AddIniFile(".env")
                .Build()
            ;

I get:

Unhandled Exception: System.IO.FileNotFoundException: The configuration file '.env' was not found and is not optional.                                                                                  
   at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load()                                                                                                                               
   at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()                                                                                                                                   
   at ConsoleApplication.Program.Main(String[] args)

Is there anything about the fact that the file starts with a dot that gets in the way here? Is there any reason why that should be a limitation?

Activity

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions