We can use this line of code.
string config = System.AppDomain.CurrentDomain.SetupInformation.ConfigurationFile
This gives the value of which config file is being retrieved & used.So if there is N layers in your application & each layer has a config file & if u want to find which config file is read the above code can be used.