Search code examples
c#visual-studio-2012configuration-files

C# converting xsd to ConfigurationSection


I am using Visual-Studio-2012

I am using ConfigurationSection class for declaring a new customized configuration section in app.config.

I need to use that in most efficient way, so:

  1. Using the Intellisense feature, so when I am writing a code in app.config, there will be automatic detection of the sections, and element collections tags. I have check that out, and find that XSD may be a solution for that.
  2. I want to auto-generate a class from xsd file (with the relevant code, using ConfigurationSection, ConfigurationProperty, etc.) - Otherwise, I need to create a template file (with relevant tags) from the ConfigurationSection class.

How can I do the above? If I cannot - What is the best way creating?

Thanks :)


Solution

    1. Yes. XSD shall be used.

      Using the Intellisense feature is done by opening the XSD file and in properties choose the schema.

    2. I have found that adding the class of ConfigurationSection is a good attitude.