When editing .NET config files (app.config, web.config, etc) in Visual Studio, I get Visual Studio's intellisense to guide me when choosing my application's settings. If I add a custom configuration section, how can I enable intellisense for my custom settings? I'm sure there must be an easy answer to this, but a cursory Google search didn't give me any help.
Thanks!
Best Answer
As the other answers say, you need to provide an XML Schema document for your custom configuration section. There's no need to add the
.xsd
schema file to some global directory; you can reference it directly from your custom section in theApp.config
file:The
xmlns
attribute is merely there to set a default namespace, so that you don't need to set it on yourcustomSection
element and all of its child elements. (However, do not place thexmlns
attribute on the<configuration>
element!)The
customSection.xsd
contains the schema that will be used by IntelliSense, for example: