How do you load the config file of the currently executing assembly via the ConfigurationManager without directly referencing/loading the config file manually?
I have an executable A which has a config file and some assembly B which has its own config file. Let's say class A in executable A executes a method of class B in assembly B. Calling ConfigurationManager.AppSettings["sometext"] attempts to retrieve the value from executable A's configuration file. How can I retrieve a value from assembly B's configuration file without manually loading assemblyB.dll.config (for example). The main entry assembly here is executable A.
I assume you're talking about doing this without hardcoding the assembly name into the file. You can use a combination of Assembly.GetExecutingAssembly().Location and OpenExeConfiguration to fetch the Configuration object for your specific running assembly.