locked
settings not synchronized with app.config, after moving it with AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE"...) RRS feed

  • Question

  • I had to change the location of the app.config file, which worked great with AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", <new-location>)

    But I have two problems now: 

    1. The settings.settings file is not updated (specifically, the app config contains a connectionstring), even if I open it. In contrast, when I used the default app.config location, when I opened setting.settings it detects that there is a gap in the data and offered to update it.

    2. what is more troublesome, is the following:

    In the new location I have connectiostring = "some connectionstring-A"

    whereas in my old location I had connectiostring = "some connectionstring-B"

    The file in the old location has already been erased. Furthermore, the string "connectionstring-B" is no where to be found textualy in any file in the directory. Yet *some parts of the the application* (I am not sure, but perhaps it is those that were designed with sql connector)  still use connectionstring-B.  It is as if the old data is stored in some other location or perhaps in some binary file. Any idea ?


     Thank you, 

    Ofer

    Wednesday, November 8, 2017 5:45 PM

All replies

  • Hi oferst24,

    Thank you for posting here.

    >>1. The settings.settings file is not updated (specifically, the app config contains a connectionstring), even if I open it. In contrast, when I used the default app.config location, when I opened setting.settings it detects that there is a gap in the data and offered to update it.

    Which seetings file does not updated? The old one or the new one? Which settings file you opened detected that there is a gap in the data and offered to update it? If you do this via code, could you provide some code which could reproduce the error for us to test?

    >>2. what is more troublesome, is the following:

    In the new location I have connectiostring = "some connectionstring-A"

    whereas in my old location I had connectiostring = "some connectionstring-B"

    According to your description, the connection of the new and old settings file are all different. What does the string "connectionsstring-B" is still be used?

    Does this mean you use the connectionstring-B in your code after the file in the old location has already been erased?

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, November 10, 2017 7:06 AM
  • Hi oferst24,

    Any update? Have you resolve the issue?

    Best regards,

    Zhanglong Wu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, November 27, 2017 10:23 AM