skip to Main Content

ConfigurationBuilder().AddJsonFile(path) says file not found but file exists

any hints as to why this throws a "configuration file was not found and is not optional" exception? string relative_path = "../../../../appsettings_global.json"; if (File.Exists(relative_path)) { IConfigurationRoot global_config = new ConfigurationBuilder().AddJsonFile(relative_path, false, true).Build(); global_settings = global_config.GetRequiredSection("Settings").Get<GLOBAL_SETTINGS>(); }

VIEW QUESTION
Back To Top
Search