Results 1 to 6 of 6

Thread: Where is application .config file?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2004
    Posts
    541

    Where is application .config file?

    Hello all,

    Can someone tell me where this is? Most places on the net say it's in same folder as the .exe, but when I look in there I don't see it. There is an .xml file in there but that doesn't look like it's it.

    Thanks,

    Strick

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Where is application .config file?

    after building it takes on the name of yourapp.exe.config ....and yes, it should be in the same place as your app. Also, make sure you're looking in the right place for it... meaning it will be in the debug or release folder in the bin directory.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2004
    Posts
    541

    Re: Where is application .config file?

    Yeah, it's the weirdest thing. Even after right clicking the project in solution explorer and clicking build it wasn't there. I also tried "build solution" and "rebuild solution" under buil menu and still no .config file. Not sure what I'm doing wrong.

    Strick

  4. #4
    Frenzied Member stateofidleness's Avatar
    Join Date
    Jan 2009
    Posts
    1,780

    Re: Where is application .config file?

    Does it always generate a config file? or only if you have Application settings that need to be stored? You might try adding a setting in the Project's properties as an Application setting, then build the project to see if it appears.

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2004
    Posts
    541

    Re: Where is application .config file?

    To add, the file must be there. Because I can access it and add to it from my program:


    Code:
    Dim config As Configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None)
            config.AppSettings.Settings.Add("MyKey", "MyValue")
    
            'Save the configuration file
            config.Save()
    
            For i As Integer = 0 To ConfigurationManager.AppSettings.Count - 1
                Console.WriteLine("{0}: {1}", ConfigurationManager.AppSettings.AllKeys(i), ConfigurationManager.AppSettings(i))
            Next
            Console.ReadKey()
    But when I go to bin folder it's not there.

  6. #6
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Where is application .config file?

    You may be getting the User.config file... which is stored in the user's profile.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

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