L
leotohill
Problem: The Configuration object created by this method looks for a
file with an extra ".config" suffix, as in
"configtest.exe.config.config"
Try this test:
create a config file with a simple key/value setting in it, and store
the file in c:\temp\configtest.exe.config.
then run
Configuration config =
OpenExeConfiguration("c:\\temp\configtest.exe.config");
Console.WriteLine(config.FilePath);
You'll see that the filename is "c:\temp\configtest.exe.config.config".
Note the extra "config" extension! That file of course does not
exist, so the settings all come up empty.
OpenExeConfiguration checks for the existence of the file you specify,
so you can't work around this by coding
"OpenExeConfig("c:\temp\configtest.exe")
However, there is a clumsy workaround. Create 2 configuration files,
one named "configtest.exe.config" and the second named
"configtest.exe.config.config". The first one allows the OpenExeConfig
to succeed, and the second one is actually used for reading the values.
Leo Tohill
file with an extra ".config" suffix, as in
"configtest.exe.config.config"
Try this test:
create a config file with a simple key/value setting in it, and store
the file in c:\temp\configtest.exe.config.
then run
Configuration config =
OpenExeConfiguration("c:\\temp\configtest.exe.config");
Console.WriteLine(config.FilePath);
You'll see that the filename is "c:\temp\configtest.exe.config.config".
Note the extra "config" extension! That file of course does not
exist, so the settings all come up empty.
OpenExeConfiguration checks for the existence of the file you specify,
so you can't work around this by coding
"OpenExeConfig("c:\temp\configtest.exe")
However, there is a clumsy workaround. Create 2 configuration files,
one named "configtest.exe.config" and the second named
"configtest.exe.config.config". The first one allows the OpenExeConfig
to succeed, and the second one is actually used for reading the values.
Leo Tohill