| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | Newsletters | VB Forums | Developer.com |
|
|||||||
| C-Sharp Programming Post questions, answers, and comments about C#. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
settings.settings == app.config ??
there are some texts around that say setting files are better then app.config. but this seems not to be the truth. I've just created one settings file and everything I wrote in the designer was saved in the app.config files. so this is not a big advantage after all. it's only some kind of a wrapper for the app.config.
__________________
win7 x86, VS 2008, C++/CLI, C#, .NET 3.5, VB.NET, VBA remeber to give feedback and if you think my response deserves recognition perhaps you may want to click the Rate this post link/button
|
|
#2
|
||||
|
||||
|
Re: settings.settings == app.config ??
Just wrapper, but usefull, because it is strongly typed and you can access the config values trought properties instead generic string keys.
__________________
|
|
#3
|
|||
|
|||
|
Re: settings.settings == app.config ??
If you are referring to the "Properties.Settings.Default", this is completely different from the app.config file. They are stored in two completely different places.
One downside of using the Properties.Settings.Default is that the file is specific for the assembly version. So if you change your assembly version, then it uses a different file and you lose any settings that were saved for the previous assembly version. Though there are ways to get around this. |
|
#4
|
|||
|
|||
|
Re: settings.settings == app.config ??
Quote:
Quote:
__________________
win7 x86, VS 2008, C++/CLI, C#, .NET 3.5, VB.NET, VBA remeber to give feedback and if you think my response deserves recognition perhaps you may want to click the Rate this post link/button
|
|
#5
|
||||
|
||||
|
Re: settings.settings == app.config ??
__________________
Arjay Need a little help with Win32 thread synchronization? Check out the following CG articles and posts: Sharing a thread safe std::queue between threads w/progress bar updating Simple Thread: Part I Simple Thread: Part II Win32 Thread Synchronization, Part I: Overview Win32 Thread Synchronization, Part 2: Helper Classes www.iridyn.com
Last edited by Arjay; September 3rd, 2009 at 12:38 PM. |
|
#6
|
|||
|
|||
|
Re: settings.settings == app.config ??
As an aside, I have encountered problems using the built in settings file. It seems that if the file is missing an exception will be thrown before main() is entered. I had to write my own settings class to avoid this.
|
|
#7
|
|||
|
|||
|
Re: settings.settings == app.config ??
the physical path is:
C:\Documents and Settings\[username]\Local Settings\Application Data\[AssemblyCompanyName]\[NameOfProject].[SomeLongUniqueString]\[AssemblyVersion]\user.config that's in XP. |
|
#8
|
|||
|
|||
|
Re: settings.settings == app.config ??
ok, now I know where each file is stored and I read the msdn-pages about settings but I didn't find how to prevent a new version of my app to overwrite the old settings.
__________________
win7 x86, VS 2008, C++/CLI, C#, .NET 3.5, VB.NET, VBA remeber to give feedback and if you think my response deserves recognition perhaps you may want to click the Rate this post link/button
|
|
#9
|
|||
|
|||
|
Re: settings.settings == app.config ??
when you change the assembly version of your application, it does NOT overwrite the old settings. If you notice in the path that I posted, the last directory is the Assembly Version. If you change the assembly version, the app will create a new folder and a new file, and begin using that file. That's how you "lose" your old settings. The old file is still there, it's just in a different directory from where the application is looking for the "user.config" file.
|
![]() |
| Bookmarks |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|