Visual Studio/Intellisense Doesn’t Recognize Registered Web Controls or Language Syntax

Technorati Tags:

Intermittently at times, Visual Studio for some odd reason, refuses to recognize web controls or C# syntax during a build/compile that you know is fine and I do not know why…it bugs the hell out of me.  You’ve included all the right usings, assembly or project references, and the syntax you know worked before, but for some reason it just decides to piss you off when you try to compile by stating it is not familiar with the syntax or control.  There are a slew of things one can try in order to sort of kick Visual Studio in the pants when you try to build, and it still can’t seem to notice those web controls even when they are in the designer file and there are no conflicts or syntax issues.  Today I has such an issue again.  When you exhaust all the tricks of the trade, the next best thing to do is ultimately just recreate the file itself and paste back in your code.

Today, I had an .aspx and in the code behind, the compiler would not recognize my web controls.  I had a custom validator controls and just some textboxes and no matter what I did (close out VS entirely, reboot, clean temp files, etc.), I still had the problem until I just renamed the troubled .aspx, created a new one from scratch with the same name, then copied back in the code.  Walla, it is fine now and compiles.

I’ve had to do this a few times throughout the years, but hey, more often or not it works and it may be faster than trying all the other avenues if you’re in a time scrunch.

You can also try removing and re-adding whatever binary (assembly) or project reference you have in the project that’s having this difficulty and re-add those references to that project.  For instance, my web project had this problem and the underlying type that Intellisense did not recognized lived in my Business Layer reference.  So just remove and re-add that reference back to your project (in my case web  project) and it may fix the Intellisense issue for you.

If you have any other successes kicking VS or Intelligence in the ass, let me know your technique or solution in these times where syntax or controls are not recognized.

 

Please kick/dzone/digg if this post if it was helpful


Print | posted on Monday, October 20, 2008 7:46 PM

Comments on this post

# re: Visual Studio/Intellisense Doesn’t Recognize Registered Web Controls or Language Syntax

Requesting Gravatar...
I have the same problem now and then but currently I can't get it to work even using your technique of creating a new file. This is so frustrating! Any other ideas?
Left by Jonz on Dec 05, 2008 4:58 PM

# re: Visual Studio/Intellisense Doesn’t Recognize Registered Web Controls or Language Syntax

Requesting Gravatar...
I can't get it to work even using your technique of creating a new file. This is so frustrating! Any other ideas?
Left by club penguin cheats on Jul 06, 2009 12:55 AM

# re: Visual Studio/Intellisense Doesn’t Recognize Registered Web Controls or Language Syntax

Requesting Gravatar...
I've found that if you cut out your code, save, and the paste your code back in, and save; sometimes intellisense will recognize the objects you've created that are legit
Left by ryan on Sep 28, 2009 3:50 PM

Your comment:

 (will show your gravatar)
 
Please add 7 and 6 and type the answer here: