|
-
July 13th, 2011, 12:51 AM
#1
using app.config..
hi all,
i was using app.config for variables that i use in the code where i can have users to change some values without compiling the code
for example, in app.config i have:
<appSettings>
<add key = "someStringVar" value = "MYNAME" />
</appSettings>
in the main code (program.cs)
string myVar;
myVar = ConfigurationSettings.AppSettings["someStringVar"];
supposedly myVar = MYNAME.. when I compile the code with this value it reads this as MYNAME.
now, i open this file in the /Debug directory (this is where the compiled file .exe is saved together with the other files) = Program1.vshost.exe.config
when I change the value to "ME", saves the file and run the .exe, it still gives me the first value of "MYNAME" instead of the new value "ME".
I placed Console.WriteLine to show/display the value of myVar and it always displays "MYNAME" as it's value.
Why is it that it don't change to the new value?
thanks in advance
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|