How to Load Config File Programmatically

前端 未结 4 1624
[愿得一人]
[愿得一人] 2020-12-01 06:42

Suppose I have a Custom Config File which corresponds to a Custom-defined ConfigurationSection and Config elements. These config classes are stored in a library.

C

4条回答
  •  我在风中等你
    2020-12-01 07:41

    Check out Jon Rista's three-part series on .NET 2.0 configuration up on CodeProject.

    • Unraveling the mysteries of .NET 2.0 configuration
    • Decoding the mysteries of .NET 2.0 configuration
    • Cracking the mysteries of .NET 2.0 configuration

    Highly recommended, well written and extremely helpful!

    You can't really load any XML fragment - what you can load is a complete, separate config file that looks and feels like app.config.

    If you want to create and design your own custom configuration sections, you should definitely also check out the Configuration Section Designer on CodePlex - a Visual Studio addin that allows you to visually design the config sections and have all the necessary plumbing code generated for you.

提交回复
热议问题