.netconfigurationweb-configintellisenseapp-config

Enabling Intellisense for Custom Sections in .config Files


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!


Solution

  • If you do not want to modify your Visual Studio files or copy anything into the Visual Studio folder, you can add the .xsd file to your project, open your .config file and select Schemas in the Properties window (click the […] icon):

    Screenshot of Visual Studio showing where to find and change the "Schemas" property of your <code>.config</code> file