I am looking for a way to programmatically get the path to the app.config file from a Windows service executable. The build process changes App.config to program-name.exe.config , and I could do something like:
var configFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "program-name.exe.config");
However, I am looking for a way to get the name of the configuration file at runtime, which does not require hard-coding the exe name in the application. The ConfigurationManager has some way to do this, so this should be possible.
c # app-config
grenade
source share