I really like the Visual Studio 2005 intellisense (See here) . There is a bug in the VS however that can stop it from working. I believe it will be fixed in the VS 2005 service pack coming in December but in the meantime here are some things to help fix the problem. Thanks to ScottGu and others for the ideas. I'm posting here so I don't forget.
Configuration Element troubles
The main thing that causes the intellisense to stop working is adding a xmlsn attribute to the root <config> element.
From Scott
There is one gotcha to be aware of, though, that can sometimes cause intellisense for the web.config file to stop working in the IDE. This happens when a default namespace is added to the root <configuration> element. For example, like so:
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
This doesn’t cause any runtime problems – but it does stop intellisense completion happening for the built-in .NET XML elements in the web.config file.
The bad news is that the built-in web admin tool (launched via the WebSite->ASP.NET Configuration menu item in VS 2005 and Visual Web Developer) always adds this xmlns namespace when it launches – so if you use this tool to manage users/roles you’ll end up having it added to your web.config file for you.
To get intellisense back when you are editing the web.config file in the IDE, just delete the xmlns reference and have the root configuration element look like so:
<configuration>
Everything will then work fine again.
Changing WebAdmin Tool
A quick fix to the WebAdmin tool will prevent your config file from getting hammered.
- Go to %windir%\Microsoft.NET\Framework\v2.0.50727\ASP.NETWebAdminFiles\App_Code
- Open the WebAdminPage.cs file
- Edit the config.NamespaceDeclared line.
Thanks to Massimo Prota