public static IConfigurationBuilder Add(this IConfigurationBuilder @this, string path, bool optional = false, bool reloadonChange = false) { path = Path.GetFullPath(Path.ChangeExtension(path, "")); var xml = @this.TryAddFile(path + ".xml", optional, reloadonChange); var json = @this.TryAddFile(path + ".json", optional, reloadonChange); var ini = @this.TryAddFile(path + ".ini", optional, reloadonChange); Assert.Any($"No xml, json or ini file added for {path}", xml, json, ini); return(@this); }