A Visual Studio add-in that allows you to graphically design .NET
Configuration Sections and automatically generates all the required code
and a schema definition (XSD) for them.
This is really good tool if you want to design your own complex configuration section in web.config or app.config. It saves you lots of trouble to write your own section handler.
You can download the add-in here: http://csd.codeplex.com/releases
Once installed, it created a new item type:
It also adds this new toolbox items in the designer surface.
For example, I want to create a configuration file as following:
Using the configuration section designer, the design is like this:
It starts with Configuration Section "SearchResultSection". You can define attributes and elements inside it. In my example, we have following elements in this section:
You can also define your own type by using "Configuration Section Exploer".
Once you saved the designer file, the add-in will generate all the required .xsd and .cs file for you. You have to add this line inside"configSections" element in your web.config file:
Right outside the "configSections" element, add this line:
The SearchResultSection.config file must be put in the same folder as your web.config file.
In your code, you can reference the configurations like this:
Enjoy coding!
This is really good tool if you want to design your own complex configuration section in web.config or app.config. It saves you lots of trouble to write your own section handler.
You can download the add-in here: http://csd.codeplex.com/releases
Once installed, it created a new item type:
It also adds this new toolbox items in the designer surface.
For example, I want to create a configuration file as following:
Using the configuration section designer, the design is like this:
It starts with Configuration Section "SearchResultSection". You can define attributes and elements inside it. In my example, we have following elements in this section:
- UserLockedField
- UserRegisteredField
- UserResetField
- CredentialFields: this is a collection that contains CredentialField element. For collection element, you have to specify which attribute is the key that can be used to find the element in the collection uniquely.
- UserDataFields: this is a collection that contains UserDataField element.
You can also define your own type by using "Configuration Section Exploer".
Once you saved the designer file, the add-in will generate all the required .xsd and .cs file for you. You have to add this line inside"configSections" element in your web.config file:
Right outside the "configSections" element, add this line:
The SearchResultSection.config file must be put in the same folder as your web.config file.
In your code, you can reference the configurations like this:
Enjoy coding!
Comments