Application Settings Location

I have been experimenting with the My.Settings feature in VS 2005.  I like the way that User-scoped settings are easily stored in a sub-folder under the user:

<c:\Documents and Settings>\<username>\[Local Settings\]Application Data\<companyname>\<appdomainname>_<eid>_<hash>\<verison>

However, I was wondering exactly where the Application-scoped settings are stored.  I was planning on using an Application setting to store my connection string to my SQL database.  A requirement by my IT guy is that this connection string needs to be be editable by him, as we might have to change it some day.  We have about 100 users that will be using this program.  In the past, I have stored this stuff in an INI or XML file on a network drive.  That way, when the program loads, the application reads the current setting from this location and my IT guy can maintain it manually.

My point is, I don't want to have to recompile the application or re-publish it just to get a setting to change for all the network users.  I want the setting to be stored somewhere on a network so that an admin can modify it & immediately ALL users will be using the new setting.

Please keep in mind that I am planning on distributing this application as a ClickOnce application.  I would appreciate any suggestions anyone could give me.

Thanx!



Answer this question

Application Settings Location

  • molecula

    Raghavendra has an excellent blog about client configuration/application settings here:

    http://blogs.msdn.com/rprabhu/articles/433979.aspx 

    If we ignore the fact that you can write your own custom settings provider and assume that you use the LocalFileSettingsProvider (which is what you get by default), connection strings are always application scoped and they will be stored in the app.exe.config file, which is located in the same directory as the executable.

    If you use click-once, the IT person should only have to update the app.config file on the deployment server, rev the publish number, and all the client applications should pick up the new app.config file.

    Best regards,
    Johan Stenberg



  • perepe

    maybe im completly wayyyy off, i do apologise...

    how about putting it in the web.config file (assuming your doing an ASP.NET app)

     

    having re-read your post....

     

    just store it in an encrypted file or something on the network, only will the application decrypt the encrypted file to obtain the connection string.

    the admin can simply have a "manager" app, which encrypted/decrypts this shared file, giving him/her the read/write priviledges except the network users who get read priviledges

     



  • wavebouncer

    Thanks for your quick reply!

    I am doing a windows forms application (not a ASP.NET app).  My problem is not that I am concerned about security regarding non-IT users changing the file.  I don't really need the file to be encrypted.

    I can revert to my "old" methods of saving the info in a INI or XML file on the network, but I was hoping to use MS's "settings" within VS to save the application-scoped setting for all users.  I was just wondering exactly where these were stored so I could evaluate if that would be a workable solution for me.

    Thanx again,

     


  • Application Settings Location