Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / August 2006

Tip: Looking for answers? Try searching our database.

Saving appSettings when using file=

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
deangelj - 29 Aug 2006 01:56 GMT
I have an app.config that looks like this:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
 <appSettings
    file="External.config" >
 </appSettings>
</configuration>

And External.config contains all my settings,  e.g.

<?xml version="1.0" encoding="utf-8" ?>
<appSettings>
 <add key="setup WebType" value="IIS" />
 <add key="setup UseEPG" value="Y" />
</appSettings>

The trouble is, when I update some settings and do a Configuration.Save()
the settings are written back to the app.config and not External.config. Is
this a bug, design feature, or is there a setting to alter this behaviour?
Using .NET 2

Thanks,
John
Miha Markic [MVP C#] - 31 Aug 2006 09:31 GMT
Hi,

The better approach would be to use Application Settings (see .net help
topics).

Signature

Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

>I have an app.config that looks like this:
>
[quoted text clipped - 21 lines]
> Thanks,
> John
deangelj - 31 Aug 2006 13:09 GMT
Hi Miha,

Not sure how this would help. I'm using the file= syntax so I can share the
config file between 3 different apps that I'm shipping. I can embed the
settings in specific config files per app but then I need to update all 3.
How does Application Settings help me in this case?

thanks,
John

> Hi,
>
> The better approach would be to use Application Settings (see .net help
> topics).

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.