You can not. Your console application expects to find the configuration file with the prefix just like the name of the console application ( MyConsoleApplication.exe MyConsoleApplication.exe.config .).
In some situations, you can share the configuration file using the file attribute in the appSettings element:
<appSettings file="path"> </appSettings>
Note that path refers to the running assembly.
As an additional note, DLLs do not even use the configuration file that you defined in the project. Again, the configuration information is read from the configuration file with the prefix in the same way as the executing assembly. Thus, even when MyLibrary.dll tries to pull the configuration information from the configuration file, it will read the configuration file for the executing assembly, not MyLibrary.dll.config .
For more information on how configuration files work, see MSDN .
source share