Multiple applications share one configuration file (ApplicationSet

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to have multiple applications sharing one configuration file
with the ApplicationSettingsBase class? If so how can i achieve this?

Thanks
 
Use the "file" attribute of the appSettings section:

<appSettings
file="relative file name" >
</appSettings>

--
HTH,

Kevin Spencer
Microsoft MVP
Software Composer

A watched clock never boils.
 
Yes multiple applications can share one coniguration file.You can define a
configuration file (.xml) and have the custom parsing code to access that.

You cannot use ApplicationSettingsBase for common config file. Because this
class will by default look for the app.config file within that appliation's
directory. So this is not possbile
 
Hi Nick,

We could share one configuration file among multiple applications, but
couldn't do it using the ApplicationSettingsBase class. For the
ApplicationSettingsBase class can only access the exe.config file of its
own project and the config file should be in the same path as the exe file.

Since the config file is an XML file, we could read/write the config file
using XMLDocument class.

Hope this helps.
If you have any concerns, please feel free to let me know.


Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi Charlie,

Do you mean that you want to use user-scoped application settings? If so, I
think you'd better not share the configuration file among multiple
applications, which means every application has its own configuration file.
And you create user-scoped application settings in the app.config file of
each application.

When we create a user-scoped application setting in VS2005, the default
value is stored in the exe.config file. If the user changes the value of
the setting at run-time, the new value will be stored in the user.config
file located in a directory related to the current user, e.g. c:\Documents
and Settings\username\Application Data\MS\applicationname\1.0.0.0. The new
value of the setting won't be seen by other users.

VS2005 takes charge of creating the user.config file and you needn't care
about where you put the user.config file on the machine.

Hope this helps.


Sincerely,
Linda Liu
Microsoft Online Community Support
 
Back
Top