In. Net platform, there are two kinds of configuration files: web.config and app.config. The former is the configuration file of Web site, and the latter is the configuration file of WinForm application. The basic library provides good support for reading these two kinds of configuration files.
However, the modification of the file itself is not very well supported. In the recent period of time, the automatic publishing tool for. Net application is prepared. When the version is published, the configuration file needs to be automatically modified. After querying the solution, the following modification methods are found:
- XML parsing method
This method requires the configuration personnel to understand the XML DOM structure, be familiar with the XPath syntax, be difficult to use, relatively complex to configure, and fully develop independently.
- XDT Transformation tool
In this way, the configuration is flexible and XDT transform is used
Tool source address:
This method is specially used to merge two configuration files. The content of the new configuration file can be added, deleted, and modified. Users do not need to understand the XPath syntax, but directly use the same file structure as the modified source. It is simple and easy to use. The online source library address is as follows:
In order to use this tool better, I need this tool to support both command line and WinForm (configuration management function). I refactored this tool and wrote WinForm program. The effect is as follows:
Source address: https://github.com/cdzhoubin/configmerge
This WinForm applet, including the use of ErrorProvider control, the use of general property verification, such as (stringlength, required), etc., the two-way binding of data and control, etc
If you are interested, you can pay more attention to the public address for more articles.