3

I'm having some trouble with Visual Studio 2010 Intellisense. In one of my projects the Intellisense doesn't display asp.net tags. However, it does still show HTML tags. All of my other projects work fine except for this one. If I type out an asp tag and build the solution it underlines the tag and says "Unrecognized tag prefix or device filter 'asp'." But it finishes the build with out any errors and all of the pages load/function correctly. At first I thought it might be my computer because it was working fine for my coworkers. I've looked at many other form pages about similar issues but their fixes haven't seemed to work for me. Here are the things I've tried so far:

Rebuilt the solution (which worked fine and everything runs correctly)

Closed/reopened visual studio

Checked my text editor settings to be sure they're correct (Tools->Options->Text Editor->All Languages. Then make sure Auto list members and parameter information are checked. Also checked Text Editor->HTML for the same settings)

Reset my settings and checked them again

Tried running visual studio as an admin

Tried running visual studio in safe mode ([Windows 7] Start button->All Programs->Microsoft Visual Studio 2010->Visual Studio Tools->Visual Studio Command Prompt-> typed: devenv.exe /SafeMode)

Deleted C:\Users[UserName]\AppData\Roaming\Microsoft\VisualStudio\10.0\ReflectedSchemas

Deleted C:\Users[UserName]\AppData\Roaming\Microsoft\VisualStudio\10.0

Tried devenv.exe /resetuserdata in the visual studio command prompt

Installed Service Pack 1

Uninstalled and reinstalled Visual Studio 2010

The problem still persisted after each of those. Today though, one of my coworkers ran into the same problem with Intellisense not working for asp tags in that same project (after getting the latest version). So I'm thinking it must be something in our files that got messed up. I assumed it would be the tagPrefix declaration in our web.config. But it looks correct to me.

Does ayone have any ideas as to what may have caused this and/or how I can fix it? I would really appreciate it!

2
  • Are you using Resharper?
    – mxmissile
    Aug 16, 2011 at 19:16
  • Nope. I haven't used Resharper before. Aug 17, 2011 at 13:57

5 Answers 5

1

Check to make sure that the asp prefix and assemblies are still registered in the web.config:

<pages>
   <controls>
    <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
   </controls>
</pages>

EDIT

If that doesn't work, take a look at this discussion:

http://social.msdn.microsoft.com/Forums/en/csharpide/thread/e442ee39-fc82-4614-8f2e-374046e39edd

5
  • Just double checked. This is exactly what I have in my web.config Aug 17, 2011 at 13:59
  • By any chance was this project migrated from an older version of .NET? Aug 17, 2011 at 14:04
  • Nope, we've never migrated the project Aug 17, 2011 at 14:29
  • Ah yes, that was one of the posts I followed for my initial fixes. My circumstances are slightly different from that one though. I'm not using any master pages and no tooltip pops up when I hover over an asp tag. Aug 17, 2011 at 14:37
  • One of the suggestions provided by the link in this answer worked for me: deleting the schema cache under %AppData%\Roaming\Microsoft\VisualStudio\10.0\ReflectedSchemas
    – robnick
    Jan 15, 2015 at 0:16
1

I had mistakenly changed parent <body> tag to <bod>y (ctrl+T does this in VS 2010) in the Master page. As a result the child asp tags were unrecognized in the .aspx page that inherited from the Master page. Fixing this was all that was needed.

Adding the tagPrefix="asp" to the web.config file as others have mentioned wasn't necessary.

0

I struggled with this issue for well over an hour, trying out all solutions out there. Finally what worked for me was to COPY the settings from a colleague who had no issues with his visual studio. FYI, go to Tools>Import and Export Settings. from there it is common sense!

0

Similar to @FuyuPersimmon, my issue was that I was using a Master Page that did not contain a < body > tag because I wanted that to be defined by the child pages so that they could each at their own id="" attribute to the < body > tag. But even after adding the < body > tag in the child pages within the asp:Content tag, the intellisense still didn't work. Apparently it gets confused by not having a matching < body > and < /body > within the same file.

0

Delete Schema Files

Delete all files in the following folder: C:\Users[UserName]\AppData\Roaming\Microsoft\VisualStudio\10.0\ReflectedSchemas.

It is safe to delete anything in this folder as Visual Studio will regenerate them as needed.

Unblock Referenced Assemblies

There could be a problem with one of the referenced assemblies in your project being blocked on your machine. Right-click on each DLL in Windows Explorer, select Properties, and click the "Unblock" button (if the DLL is being blocked.)

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.