Configuration File refresh configurationmanager. refreshsection usage Problems

Source: Internet
Author: User

The winform program configuration file is read into the cache after the winform program is started. to modify the configuration file through the program, you must restart the winform program to read the updated configuration file.

Add reference system. after configuration, you can use configurationmanager. refreshsection ("etettings") method to refresh the appsettings node. After refreshing, you do not need to restart the winform program. You can read the updated configuration file information;

Configurationmanager. the refreshsection method is used to refresh the content read to the cache, but the refreshsection refreshes only a limited number of nodes and custom nodes cannot be refreshed. For example, my winform client is connected to the WCF Service, the node of the WCF Service in the configuration file is: "system. servicemodel/client ", this node cannot be refreshed through the refreshsection method, but can only restart the winform program.

Configuration File refresh configurationmanager. refreshsection usage Problems

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.