How to SetBasePath in ConfigurationBuilder in Core 2.0

前端 未结 3 1242
谎友^
谎友^ 2020-12-02 12:53

How can I set the base path in ConfigurationBuilder in Core 2.0.

I have googled and found this question, this from Microsoft docs, and the 2.0 docs online but they

3条回答
  •  萌比男神i
    2020-12-02 13:33

    The SetBasePath extension method is defined in Config.FileExtensions.

    You need to add a reference to the Microsoft.Extensions.Configuration.FileExtensions package.

    To resolve AddJsonFile, add a reference to the Microsoft.Extensions.Configuration.Json package.

提交回复
热议问题