Is it possible to load data from a configuration file within a assembly
(class library)? The hosting exe file is something completely different
which isn't gonna load my config file.
I already added a App.config to my project and its copied to my output
directory on build. Only it seems its not automatically loaded (is this
only possible with executables or asp.net?).
Normally you can call the configurationmanager to get a custom section
(or appsetting).
I use this to get a section.
ConfigurationManager.GetSection("samplesection"). Only this returns
null in my case. Appsetings is also empty.
I know its also possible with
ConfigurationManager.OpenMappedExeConfiguration and then giving it a
complete path to the config file. Only this requires a constant value
telling me the name of the configuration file which I preffer not. I
rather have it loaded automatically (if possible offcourse).
Any thoughts?