Link to home
Start Free TrialLog in
Avatar of surajguptha
surajgupthaFlag for United States of America

asked on

Resx Problem

Hi,
     I am using a resx file in my project which has key, value pairs. I have used a resx file so that a user will have to just change the resx file values to set some configuration values. I use a resourcemanager class's getString function to get the strings from the resx file. I am using the .EXE now.

The problem is that when i change the values of the resx file, the changed values are not used by the EXE.

Can anyone help me?

Thanks,
Suraj
Avatar of YZlat
YZlat
Flag of United States of America image

you need to compile resx to a temporary .resources file in order to embed it into a DLL
try editing your resx files using note pad
The Resx files are compiled and merged with assembly. Every time you change them you need to build the assembly. So i will suggest you to use the Configuratiojn files for configuration values.
Jatinder
Avatar of surajguptha

ASKER

Hi Jatinder,
                Can configuration files be read as easily as an resx can be read using resourcemanager?? Is there a class to read the config files easily??

regards,
Suraj
Yes, there is the ConfigurationSettings.AppSettings property

Bob
Hey Bob,
            I cannot understand what you mean by the ConfigurationSettings.AppSettings property. Can u kindly explain?
ASKER CERTIFIED SOLUTION
Avatar of jatinderalagh
jatinderalagh
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yeah, that's what I meant :)

Bob
Cool. Just incase i want to use another config file other than the app.config how can i read the key, value pairs?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@Bob: that's nice article.

@Suraj:
In case you wish to use simple xml file then you can use the XMLReader class for reding the xml. But using config file is easy as it can be read as key vakue pair. You can even use plain text file. Then you will be required to read and parse the text from file.
And if you want to complicate the life you can use the registry for this purpose.

Jatinder