Get filename of current configuration file

using System.Configuration;
Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
Console.WriteLine(config.FilePath);

In the odd case that you have separate configuration files for specific local or roaming users, you can locate those as well using the correct ConfigurationUserLevel. For web applications, use

WebConfigurationManager.OpenWebConfiguration("~");

Try AppDomain.CurrentDomain.SetupInformation.ConfigurationFile

https://docs.microsoft.com/en-us/dotnet/api/system.appdomainsetup.configurationfile