I have a test application that is calling an assembly that reads some
strings out of a config file. Normally, this assembly supports a web
application and the information can be read just fine. Then I created a C#
test application and ran the function. The function fails because the
configuration read is failing to find a key. I created an application config
and copied the keys over to the app config file but the app is still failing
to find the keys. It isn't clear what the problem is. Maybe the app is not
finding the config file or perhaps there's something else going on. Where
should the app exe config go?
Here's the situation:
Dev Studio 2003.
D:\Projects\A\bin contains a dozen different assemblies that the test
program needs.
Test program is output to D:\Projects\A\bin.
Name of test program is TestAccount.exe.
Name of app config is TestAccount.exe.config.
When I put the config in D:\Projects\A\bin, the application throws an error
because it can't read a key from the config file.
Oddly, after the program has run, the config file is no longer present in
D:\Projects\A\bin. Could it be that the config file is getting deleted as
soon as the program tries to read the key?
Thinking that maybe the executable's directory wasn't the right place, I
tried other places (Windows, Windows\System32 and a bunch of other places)
but that didn't seem to work.
--
Richard Lewis Haggard
www.Haggard-And-Associates.com