It's incredibly annoying...but sometimes Visual Studio seems to "forget" to use intellisense when editing .config files. With Visual Studio 2008...it seems to be fixed...so they say. It is actually fixed...but sometimes appears not to be. Here's why, and how to fix it:
If your app.config or web.config file is part of your project, it must be targeted to .NET 3.0 or higher, and there must not be a namespace defined on the root <configuration> element. If this is the case, intellisense should work just fine. If you just did a "File | Open" on a .config file, then you have to do something differently.
In your C:\Program Files\Microsoft Visual Studio 9.0\Xml\Schemas, there is a file called catalog.xml. This file contains the following tags:
<Association extension="config" schema="%InstallRoot%/xml/schemas/dotNetConfig20.xsd" condition="%TargetFrameworkVersion% = 2.0" />
<Association extension="config" schema="%InstallRoot%/xml/schemas/dotNetConfig30.xsd" condition="%TargetFrameworkVersion% = 3.0" />
<Association extension="config" schema="%InstallRoot%/xml/schemas/dotNetConfig.xsd" condition="%TargetFrameworkVersion% != 2.0 and %TargetFrameworkVersion% != 3.0" />
These tags associate all .config extension xml files with the specified schemas based on the target framework version. If the file is not part of a current project, is has no framework version. In this case, the 2.0 version is somehow picked up. You will have some configuration options, but not the WCF ones.
What I did on my configuration is to ALWAYS use the 3.0 schema with .config files. So I commented out the above lines, and added the following:
<Association extension="config" schema="%InstallRoot%/xml/schemas/dotNetConfig30.xsd" />
Now my intellisense works...but if I happen to be modifying a 1.1 schema (like I do that so often), then I will get options that are not applicable. Oh well. You can tinker with the conditions to your liking.
c5b2bab1-ea7d-4d19-9747-b4f20aa7b4fe|0|.0
Development
visual studio