views:

692

answers:

2

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!

+6  A: 

You need to create an XSD file for your custom settings and copy it to the schema directory of your visual Studio install. For 2005, this is: %ProgramFiles%\Microsoft Visual Studio 8\XML\Schemas

Here some information on this. http://blogs.msdn.com/astebner/archive/2005/12/07/501466.aspx

Jose Basilio
Excellent. Thanks!
Kevin Babcock
+2  A: 

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 ...).

Properties

Michael Stum
+1 The accepted solution seems widely practiced, but you shouldn't do this unless the schema changes are standard and useful to all the Visual Studio projects that may be created on your computer.(http://msdn.microsoft.com/en-us/library/ms255821.aspx)
Paul