I have two projects, one is an application (exe) and the other is a library (dll). I am dynamically loading the library from the application. I am trying to access exe app.config from a dll. Here is the code from the DLL:
config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); object abc = config.Sections["MySection"];
If I have a link from the project program to the library project, then the above code works fine. But if I delete the link, I get a System.IO.FileNotFoundException.
HasFile's configuration property is true, but it looks like it cannot find a section or something like that. So I thought that maybe it uses a different aap.config file, and I tried to manually specify the app.config path in OpenExeConfiguration, but I still get the same error.
So, how can I access the app.config program from a DLL without having a link to this DLL from the program project?
source share