Add Visual Studio intellisense support for custom configuration section

On my main project we use heavily the awesome log4net framework. It could be quite easily configured but for some advanced configuration I need to constantly check the documentation. I personally prefer to have all required knowledge on how write configuration in Visual Studio.
Fortunately VS allows to add intellisense support for custom configuration section (like log4net or whatever you want).

As configuration file is still XML, what you need is to provide the XSD schema to the editor. And you got intellisense do hard work for you. See how:

  1. Find configuration file.
  2. Open file for edit. Its properties window should be seen in the bottom right corner of the VS editor (default settings). 
  3. Click on ‘Schemas’ row:
    Edit XSD schemas for XML
  4. You could see tons of already included XSD schemas that makes editing configuration file so playful! Click on “Add” to choose schema. I downloaded log4net XSD here beforehand.
    Manage XML Schemas
    Then you will see new schema now included into the configuration file schemas.
    Log4net XSD successfully added
  5. The last this is to test it. Start typing app.
    Intellisense power

Looks like it work now. Great!

So this was a tip on how to include custom configuration section intellisense support.

This entry was posted in VS 2013 tips. Bookmark the permalink.

1 Response to Add Visual Studio intellisense support for custom configuration section

  1. Mark says:

    Please what does this mean? “Hit whenever in config file. Then look at ‘Properties’ sub window ( by default, it is in the bottom right corner). Click on ‘Schemas’ row:”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.