I am learning to use the Configuration and Application settings in VB.NET
(VS2005)
I understand the two different Scopes, Application and User, and that the
Application Scope settings are Read-Only. These work great for what I need,
except for a few things.
First, for the User Settings, if you simply move the Executable from one
folder to another (I.e. from the desktop to a folder on the desktop), or even
rename it, the User Settings are lost. Can't the app use the same config
file, even if the EXE name or location changes?
Second, It seems to make sense to me when it is suggested to save things
like Database connections as Application Settings. What I don't understand
though, is that if this needs to change (i.e. a new server?), how would you
change this connection string?
Is there a better way to accomplish what i'm trying to do?
Thanks for any suggestions
MATT
Herfried K. Wagner [MVP] - 28 Mar 2007 23:14 GMT
"MATT" <MATT@discussions.microsoft.com> schrieb:
> I understand the two different Scopes, Application and User, and that the
> Application Scope settings are Read-Only. These work great for what I
[quoted text clipped - 6 lines]
> rename it, the User Settings are lost. Can't the app use the same config
> file, even if the EXE name or location changes?
.NET applications are typically deployed using a setup package in order to
prevent such problems.
> Second, It seems to make sense to me when it is suggested to save things
> like Database connections as Application Settings. What I don't
> understand
> though, is that if this needs to change (i.e. a new server?), how would
> you
> change this connection string?
The administrator would change it directly in the config file.

Signature
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>