none
Where is My.Settings file for user settings saved? I want to edit that file with notepad.

    Question

  • I cannot seem to find the text/xml file that My.Settings are saved in. I thought I'd be able to find it using Windows Search but even though I figured out how to see hidden folders, I'm not sure Windows Search is searching there.

    My Project is named IsaacScripting and it was written in VB. I use Visual Studio 2012 Update 3. What would be the name and path of the file with my user settings in it?

    Where will my Application Settings be found? In the deployment path?


    Durham Regional Cancer Centre, Canada

    Sunday, September 22, 2013 5:27 PM

Answers

All replies

  • I am not familiar with a file of that name. What application creates and uses the My.Settings file?

    Regards

    Adrian

    Monday, September 23, 2013 8:08 AM
  • Hi Adrian,

    I don't think that is exactly the file name. In fact what I am looking for is the "file name". From within VB I access the values in that file as follows

    Dim LIVEorTEST As String = My.Settings.LIVEorTEST

    I thought it was a dot net framework thing.

    JT


    Durham Regional Cancer Centre, Canada

    Monday, September 23, 2013 1:00 PM
  • Hello,

    I have moved this thread to Visual Basic forum for better response.

    Thanks,


    Amanda Zhu <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Tuesday, September 24, 2013 1:32 AM
  • Hi,

    You can change the type of a setting by using the Scope property.

    The project system stores application settings in two XML files: an app.config file, which is created at design time when you create the first application setting; and a user.config file, which is created at run time when the user who runs the application changes the value of any user setting. Notice that changes in user settings are not written to disk unless the application specifically calls a method to do this.

    I suggest you check this link to get more information.

    You can also refer to these links below:

    References:

    http://social.msdn.microsoft.com/Forums/en-US/ed1491b4-65ed-4a06-a770-d37d863ec24e/how-do-i-persiststore-user-settings-using-mysettings-in-vbnet

    http://stackoverflow.com/questions/8691858/where-are-my-settings-saved-in-vb-2010-net

    Hope it helps.

    Regards.


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Tuesday, September 24, 2013 1:48 AM
  • I cannot seem to find the text/xml file that My.Settings are saved in. I thought I'd be able to find it using Windows Search but even though I figured out how to see hidden folders, I'm not sure Windows Search is searching there.

    There is some discussion here:

    http://social.msdn.microsoft.com/Forums/vstudio/en-US/4f3e1f68-d19c-4a43-a650-bd4afa9c4593/c-application-settings-where-are-they-stored

    but note that those comments assume some particular setup of your application.  For instance, that location changes when you publish the app.   See:
    http://msdn.microsoft.com/en-us/library/8eyb2ct1.aspx
    (about
    half way down)

    If you synchronise your settings you will see the locations that are searched as possible sources for the file to synchronise.  - they can become extremely complex. 

    There should not normally be any requirement to find the location of this file, and MS has not made it easy.  You should reconsider your requirement to edit it.

    • Marked as answer by Toop Tuesday, September 24, 2013 2:26 PM
    Tuesday, September 24, 2013 2:27 AM
  • I wrote the application to point to a UAT environment and completed testing. I have connection strings and various variables for testing that change when the application is deployed to a production environment. I thought I'd use the settings so that I could just change them with notepad to get the application into production. I'm trying to avoid having a set of code for production and a set for user acceptance testing. I suppose this needs some more thought.

    Perhaps I should avoid using settings as something that I can change, for that reason.

    JT


    Durham Regional Cancer Centre, Canada

    Tuesday, September 24, 2013 2:24 PM
  • I wrote the application to point to a UAT environment and completed testing. I have connection strings and various variables for testing that change when the application is deployed to a production environment. I thought I'd use the settings so that I could just change them with notepad to get the application into production. I'm trying to avoid having a set of code for production and a set for user acceptance testing.

    You should be using User Settings, because they are something that you can change.  But you change them through application code, not by editing the file.  For UAT there will be either a command line parameter or a selection on the options page that sets the settings values to those required for the testing.  This value is then saved into the settings file when the application closes and becomes the default at startup for that environment.  For production, the command line argument is omitted, or the option switch on the option page is left as is, and the settings values are initialised to the defaults set at design time, and stay like that. 

    Tuesday, September 24, 2013 9:05 PM