I am currently experiencing an issue that I haven't been able to resolve.
I have an application where I have this code:
AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", "App.config");
AppDomain.CurrentDomain.SetupInformation.ConfigurationFile = Path.Combine(System.Reflection.Assembly.GetExecutingAssembly().Location, "App.config");
MessageBox.Show(ConfigurationSettings.AppSettings.Count.ToString());
The configuration file is indeed called App.config in the application folder (I am doing this because I have two applications reading/modifying the same config file).
When I start either of them through the Visual Studio Debugger, it correctly tells me that I have 11 appsettings. However, when run outside of the debugger, I get 0.
What might be wrong here? I am 100% sure that this code has worked in the past.