Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8814763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:12:40+00:00 2026-06-14T04:12:40+00:00

Using the ConfigurationManager code/annotation configuration, I can define a rich, typed model for my

  • 0

Using the ConfigurationManager code/annotation configuration, I can define a rich, typed model for my app.config structure.
Is there a way (or tool or special incantation) to generate the corresponding XSD from this code-based model?

Having an XSD-schema makes it awesome to edit configuration files! (never thought I’d say that 🙂

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T04:12:41+00:00Added an answer on June 14, 2026 at 4:12 am

    So far, I found the lovely-looking Configuration Section Designer VS plugin and it generates XSD in addition to code!
    But this is a designer-only solution and lacks a bit of flexibility (plus I’m afraid a designer-based solution is harder to scale).

    LATER EDIT

    I ended up giving Configuration Section Designer a more serious chance and I’m loving it! As it turns out, it’s plenty flexible for my purpose. Here’s shot of a part of my configuration definition:

    enter image description here

    Pros:

    • Easy to use
    • Generates XSD for the config file
    • Generates a (bare-bones) app.config file
    • Flexible, supports lots of the customizations exposed by ConfigurationManager. Here are some of the ones I used:
      • Enum support (that trickles all the way to the generated XSD, so you get IntelliSense when filling in attribute values
      • ‘Default collection’ for sections, so you can support <section><item/><item/><section> instead of <section><items><item/><item/></items><section>
      • Out of the box support for type ‘System.Type’ for attributes (and the associated converter)
      • option to generate strongly-typed element collections (implementing ICollection)
      • input validators, including custom (roll-your-own)
      • Type converters for loading/storing elements with properties of any types, including Roll-your-own
      • Config element inheritance

    I’m sure there are other things that I forgot about.

    A few drawbacks:

    • The documentation is not exhaustive (although it does send you in the right direction)
    • The errors that sometimes show up are not very explicit (along the lines of "something went ‘splat’ in CodeDom"), but so far it’s always been a problem in my model (e.g. I forgot to assign a property).

    But these are minor nuissances.

    Overall, I got the job done quickly and easily. Thumbs up!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Castle Windsor with a configuration from my App.config file. In the code
I am using following code to replace the passwords in my app.config. It replaces
I can add the statement using System.Configuration; to my code using intellisense, but I
I'm trying to update a value in my app.config file using the code below
I'm trying to persist user settings to a configuration file using ConfigurationManager. I want
I was using a certain method for parsing my app.config file. Then I was
I'm using this code (in my DAL project): ConfigurationManager.AppSettings[server] to access appsettings section in
How can I make the code string connStr = ConfigurationManager.ConnectionStrings staceys_cakesConnectionString].ConnectionString; work generically and
I usually use code like this: using (var connection = new SqlConnection(ConfigurationManager.ConnectionStrings[MyConn].ConnectionString)) { var
I am using this class for writing into config file. Code is builted and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.