You can not. The .NET configuration system will always try to find (exe file name) .config - for your foo.exe .NET will always look for foo.exe.config . There is no switch or setting or anything to change.
If you really want to deviate from this convention (really?), You need to collapse your own using the Configuration class from the System.Configuration namespace.
If you really have to change the configuration name (again: really? And why?), Use this code:
ExeConfigurationFileMap map = new ExeConfigurationFileMap(); map.ExeConfigFilename = "Custom.config";
You need to add "custom.config" to your project and make sure that it is "copied to the output directory if it is newer."
It works - you can basically upload any file you want, but nonetheless itβs a bit of a bug ...
source share