Fix for "'asp' is an unrecognized tag prefix"

by timvasil 11/15/2007 1:14:00 PM

Recently, while using the beta 2 version of Visual Studio 2008, IntelliSense stopped working when editing .aspx pages and master pages.  Well, it was more than just IntelliSense not working.  I was getting horrible validation errors, such as 'asp' is an unrecocognized tag prefix or device filter.  Considering 'asp' is one of those tag prefixes that should always be defined (thank you, machine.config), I knew something was horribly wrong.  Sources on the web had me try all sorts of things:

  • Make sure the MasterPage is open,
  • Close VS and delete all files in C:\Documents and Settings\{username}\Application Data\Microsoft\VisualStudio\9.0\ReflectedSchemas, and
  • Ensure the file is rooted in an <html> or <body> tag.

No, no, no.  None of that worked.

So then I tried closing the solution, deleting its .suo file (just a work file that can be regenerated), and deleting all files in the obj and bin directories.  And then, like magic, IntelliSense and validation started working again!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

ASP.NET | Visual Studio

Related posts

Comments

4/17/2008 10:46:43 AM

Mark Hough

Hi,
I'm having exactly the same problem with a full version of vs2008. I also tried the things you've tried and have unanswered requests about it on a couple of forums....before stumbling across your blog. However I'm afraid I don't understand your solution.

".suo" file - what's this? I don't have an obj directory at all, and don't understand how clearing the bin directory would help. Also, since this cropped up for vs2008, my copy of vs2005 does the same thing for this particular site. The guy I sit next to, running vs2005 only, does not have this problem on the site or any other.

Any help you could give me would be most appreciated. I've tried deleting my solution folder in both vs2008 and vs2005 but it has no effect.

Many thanks,

Mark

Mark Hough gb

4/17/2008 11:35:08 AM

Mark Hough

FYI - I looked up suo's and I don't have one.....do these get generated by 2005 and 2008? I have sln's....?

Mark Hough gb

4/17/2008 6:58:19 PM

Tim Vasil

Mark,

Sorry to hear you're having trouble even after trying all of those options. One thing to check: are you having this problem across all solutions, or only with a specific solution? What if you create a new project in a new solution? Answering those questions will at least narrow down the problem to either something specific to a project/solution, or Visual Studio itself. If the latter, you may want to try doing a 'Repair' on the installation using the setup program.

FYI, the .sou file is a binary file used by Visual Studio to store user-specific information related to the solution--like which files you have open--so it can restore state when you reopen the solution later. Since this is a user-specific file, it's something that you don't check into source control if you're sharing the solution with others. If corrupted, it's something you can safey delete, as the IDE recreates it when you reopen the solution.

Tim Vasil us

4/18/2008 4:38:43 AM

Mark Hough

Actually, this morning, the guy next to me is now having the same problem, whereas yesterday, he wasn't.....

Might swtich to PHP....

Mark Hough gb

5/5/2008 6:34:42 PM

martin fowmes

Thanks Mark. Removing the obj/bin and more importantly the .suo sorted out my problem! You're a star!

martin fowmes gb

10/11/2008 5:54:41 PM

JeffMac

None of the above fixes worked for me, either.

However, I was able to fix it by adding "runat=server" to the <body> tag in my master file (not sure why it wasn't already there). I'm using Visual Studio 2008 version 9.0.21002.8 RTM with .NET Framework 3.5.

Hope this helps.

JeffMac us

12/8/2009 10:22:06 AM

Rohan Cragg

Thanks for posting. I had the same problem. I posted my solution here:

stackoverflow.com/.../1867326#1867326

Rohan Cragg gb

Comments are closed

 

About the author

Tim Vasil Tim Vasil
I'm a software engineer living in Cambridge, MA.

E-mail me Send mail

Search

Calendar

<<  September 2010  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar

Recent comments