I have a COM component written in C# that makes calls to ConfigurationManager.AppSettings.Get(...). This component is instantiated inside an unmanaged C++ application.
Every time, ConfigurationManager.AppSettings is unable to read the configuration file.
There might be two problems.
1) What should the app.config be called when the app is running (i.e. the name of the C++ exe with .config on the end, or the name of my C# class library with .config on the end).
2) Where should the config file live (i.e. in the same folder as the C# COM Component, or in the same folder as the C++ exe
I've tried various calls to ConfigurationManager.OpenExecConfiguration; all failed.
What I want ideally, is for it to just work with no code changes. Failing that, a judicious call of OpenExeConfiguration so that I can still use ConfigurationManager.AppSettings.Get(...)
This might be the tip of the iceberg because I'd like to use log4net in the C# COM Component which uses a custom config section.
Whilst I dont mind changing my own code to use access settings via a config object, I can't change the log4net code.
Anyone else hit this before? Any ideas?