none
OpenExeConfiguration doesn't open given config file RRS feed

  • Question

  • I want to open own config file and want to load own custom settings through given config file. so i have used ConfigurationManager.OpenExeConfiguration(givenConfigFile).

    Given config file is same as default app.config only different is that in givenConfigFile contains only AppSettings & ConnectionSettings section. structure is also same as default app.config.

    Using OpenExeConfiguration i couldn't get appsettings and connectionsettings.

    Please can anyone help me ?

     

    Thursday, May 19, 2011 7:23 AM

Answers

  • You cant open any xml file using that method. It will only work with the one and only "<app>.exe.config".

    Thursday, May 19, 2011 10:29 AM
  • Hi Segi,

    In addition to Werner Clausen's explanation, if you want to open a specific config file, try using ConfigurationManeger.OpenMappedExeConfiguration method.

    See here for more information.

    If you still have any questions or concerns about this issue, please feel free to let me know.

    Best regards,

     


    Min Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    Tuesday, May 24, 2011 7:30 AM
    Moderator

All replies

  • You cant open any xml file using that method. It will only work with the one and only "<app>.exe.config".

    Thursday, May 19, 2011 10:29 AM
  • Hi Segi,

    In addition to Werner Clausen's explanation, if you want to open a specific config file, try using ConfigurationManeger.OpenMappedExeConfiguration method.

    See here for more information.

    If you still have any questions or concerns about this issue, please feel free to let me know.

    Best regards,

     


    Min Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    Tuesday, May 24, 2011 7:30 AM
    Moderator