Walt Ritscher: Thinking about code

Thoughts about .Net - Thoughts about code

  Home :: Contact :: Syndication  :: Login
  171 Posts :: 0 Stories :: 80 Comments :: 23 Trackbacks

Archives

Post Categories

Image Galleries

About Me

Interesting Blogs

My other blogs

Resources

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.

  1. Go to  %windir%\Microsoft.NET\Framework\v2.0.50727\ASP.NETWebAdminFiles\App_Code
  2. Open the WebAdminPage.cs file
  3. Edit the config.NamespaceDeclared line.

Thanks to Massimo Prota

 


posted on Saturday, August 26, 2006 10:53 AM

Feedback

# re: Bug Fix: Disappearing Intellisense in ASP.NET web.config 12/21/2006 4:30 AM Howard
You rock!

Comments Closed! Due to the spam creeps.
If you want to comment, use the contact page and send me an email and the URL of this Post.
Title  
Name  
Url

Comments   
Enter the code you see: