CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2010
    Location
    Germany
    Posts
    2,675

    .config files: Back to the .ini file paradigm?

    I'm relatively new to .NET, so I might be missing some essential points. But one of the things I have learned so far is that .NET uses these appname.exe.config files to store (local) application settings. To me this surprisingly resembles the way they were stored in .ini files in the ancient days of Windows 3.10 etc. before the registry became en vogue , though in a much fancier way. Is using the registry really deprecated under .NET? It looks like there is no ".NET way" of accessing the registry at all.

    One of the things I liked the most about the registry was being able to bind settings to a certain user by storing them somewhere under HKCU\Software\.... It looks like something similar is possible with .NET's .config files, too, but what I read about that so far didn't really appear clear to me. I think it has something to do with System::Configuration::ConfigurationManager::OpenMappedExeConfiguration(), in conjunction with the ConfigurationUserLevel object passed to that method. Can someone give me a brief breakdown on where and how these user-specific .config data is stored? I really don't need anything conprehensive, I can still dig that out of MSDN and maybe other sources.

    One of the potential problems I suspect to be around this topic is that the default .config file appears to be usually stored in the application directory, where non-admin users usually don't have write permission. As a consequence of this fact I suppose that a user-specific storage location for app settings is mandatory, unless I'm missing something again...

    TIA
    Last edited by Eri523; August 20th, 2010 at 12:24 AM.

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: .config files: Back to the .ini file paradigm?

    Consider the AppConfig file as read only data for your application.

    So if your app connected to a webservice or database, the connection settings would be stored in the AppConfig.

    For user settings, use Application Settings.

    See http://msdn.microsoft.com/en-us/libr...xh(VS.80).aspx

  3. #3
    Join Date
    Jun 2010
    Location
    Germany
    Posts
    2,675

    Re: .config files: Back to the .ini file paradigm?

    Thanks for that link, Arjay. I didn't come across that page during my previous research and it looks like a good place to start from. I will re-read it and check out all these links from there onward after some sleep. I'm way beyond the overflow point of my time zone right now...

    It refers to some things like the My namespace and the My.Settings object, that appear to be VB-specific though. But I'm confident that I can transfer at least most of it to the environment I'm using.

    Yes, I have been warned...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured