App.config or Resources.resx
-
Should I use my app.config file or the Resources.resx in VS2008 to store the connection string for my DB? I am not sure which one would be better should I later on decide that I want to give the user the option to edit this.
The resx files are being compiled into your assembly, so you'll not be able to change stuff in it without recompile. If you plan to give users possibility to change the stuff choose appconfig
Regards, Lev
-
The resx files are being compiled into your assembly, so you'll not be able to change stuff in it without recompile. If you plan to give users possibility to change the stuff choose appconfig
Regards, Lev
-
The resx files are being compiled into your assembly, so you'll not be able to change stuff in it without recompile. If you plan to give users possibility to change the stuff choose appconfig
Regards, Lev
Lev Danielyan wrote:
If you plan to give users possibility to change the stuff choose appconfig
I agree with this recommendation. If it's a setting you want the user to be able to configure use the app.config file. resx files are for more fixed resources that only you provide.
Lev Danielyan wrote:
so you'll not be able to change stuff in it without recompile
Not quite strictly true. Resources can be compiled into satellite assemblies so you can provide a new set of resources without recompiling the app. (This is mainly used for things like internationalisation & localisation. a satellite assembly will be produced for all the different languages the app is used in).
Simon
-
Lev Danielyan wrote:
If you plan to give users possibility to change the stuff choose appconfig
I agree with this recommendation. If it's a setting you want the user to be able to configure use the app.config file. resx files are for more fixed resources that only you provide.
Lev Danielyan wrote:
so you'll not be able to change stuff in it without recompile
Not quite strictly true. Resources can be compiled into satellite assemblies so you can provide a new set of resources without recompiling the app. (This is mainly used for things like internationalisation & localisation. a satellite assembly will be produced for all the different languages the app is used in).
Simon
Right, but you will still need to recompile the satellite assemblies ;)
Regards, Lev