开发者

Visual Studio 2008: No Intellisense in web.config

My web.config no longer has Intellisense nor colour highlighting. It looks like a regular text docu开发者_JS百科ment. Any idea why this would occur?

Thanks!


All,

I've fixed it by doing the following:

Opening up the VS2K8 command prompt and running the following command:

devenv /setup

Now we're back in business.

Thanks all!


Try to reset your settings : Tools > Import and Export Settings and choose Reset All settings. (maybe you want to make an export first if this does not work).

HTH


You might be having this kind of problem (Scott Gu reporting on VS 2005):

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

How to fix this gotcha:

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


You could try looking at the settings at:

Text Editor -> All Languages

There are some checkboxes for statement completion that need to be checked for intellisense. You can also try looking at the same settings but specific to XML files in that panel.

Alternatively, you can try this:

  1. Close your project
  2. Delete the .ncb file for it
  3. Re-open the project

This will cause Visual Studio to recreate the intellisense database, and might solve the problem.


You could also try checking the extension on the file... Not saying I do this... but some people... forget to put an extension when saving and that can throw intellisense off.


I too have non syntax highlighted Web.Config in VS2008. I tried the following to remedy it, but nothing worked:

  • Control Panel > Add/Remove Programs > double-click MS Visual Studio 2008 and selected Repair option. This fixed someone else's problem, but not mine.
  • Launch VS 2008's Command Prompt and type: devenv /setup
  • Make sure that Web.Config starts with as the topmost element by removing

I'll keep trying other things and report back what works when I come across it.


More likely than not you have a "corrupt" DotNetConfig.xsd. This is the primary file used for VisualStudio's intellisense.

This file can be found at "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Xml\Schemas\DotNetConfig.xsd"

Though there may be similar files named:

  • DotNetConfig20.xsd
  • DotNetConfig30.xsd
  • DotNetConfig35.xsd

The only one you should make sure is the same as the default installed version is the DotNetConfig.xsd.

I tried to include mine from my VS2010 SP1 Ultimate install, but the text was truncated. Try to grab one from a default install.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜