VS Intellisense Mental Lapse
February 8, 2009 at 11:03 AM
Yesterday I was working on a C# web site project in VS 2008. After making some modifications to a class in the App_Code folder, when I later went back to the codefile for an ASPX webpage, intellisense no longer recognized the class or methods of the class I was earlier changing. I wasn't getting the normal coloring for the class name and no intellisense listing of the class's methods. Right-clicking on the class or its methods and trying to 'Go to Definition' resulted in a message stating it couldn't find the definition (or something to that effect).
I could build and run the site with no errors. I tried closing and re-opening the solution, tried closing and re-opening VS, tried deleting all the files in the Temporary ASP.NET Files directory, tried restarting IIS and tried rebooting the PC. Nothing worked. After rebooting the PC, intellisense even stopped recognizing another App_Code class. Life without intellisense sucks!
What finally did work was to right click on these classes in the solution explorer, select the 'Exclude from Project' option which excludes the files from the project by giving the files .exclude extensions, and then I right-clicked on the files again to Include them in the project. That cured intellisense.