An interesting problem one of my fellow developers faced recently was losing Intellisense in Visual Studio 2003. The interesting problem was Intellisense only was lost on web forms and in user controls and only for form objects like buttons and labels.
Since Intellisense knew nothing about our controls such as buttons, it would stand to reason that Visual Studio knew nothing about them at all. This proved true when our events assigned in the OnInit() method kept disappearing. When a button, for example, is added to a web form and the OnClick() event is implemented but later removed also removes the events subscription in OnInit(). We were losing our events so this told us Visual Studio knew nothing of our controls.
The problems didn’t happen all at once and where not very consistent either and got progressively worse. We started by looking at the forms on the problem system and looking at the very same form on two different systems without any Intellisense problems, the form controls came up in Intellisense just fine. This tells us it’s the system and not a code-related problem.
I have had minor issues with Intellisense losing reference to various objects in the past, but a simple closing the solution and reloading normally fixed the issues. In extreme cases, closing Visual Studio was required but nothing more. This approach did not fix our problems.
Our next step was to delete all of the files in the ASP.NET Cache located in C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files. This is the location temporary files such as assemblies are copied. After deleting these files we performed an IISReset to make sure IIS had a fresh start. Trying Intellisense again in our project resulted in the same problems.
We also use various add-ins and third-party components. Deciding to remove all of these, trying Intellisense again, reinstalling and other such things did not work.
We decided to give Microsoft a call and use one of our MSDN Universal incidents. The call turned out to be worth the effort to learn this occurs in Visual Studio 2003 more often than I would expect. In order to fix the problem we had to perform the following steps:
- Delete all files in the applications \bin directory (we had already done this)
- Delete all files and directories in the C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files directory (we had already done this)
- Delete all files in the VSWebCache. (we hadn’t tried this). This directory is normally located in your documents and settings such as this – C:\Documents and Settings\rbazinet\VSWebCache.
- Perform an IISReset
I was not even aware Visual Studio cached anything under my profile. Well, after the IISReset and restarting Visual Studio and reloading the project, Intellisense had returned to it’s normal self.
Wow, what a way to fix a problem that should not be a problem in the first place. I would expect this to be a bug fixed in Visual Studio but there doesn’t seem to be a hotfix available. Let’s hope this is not an issue in Visual Studio 2005.
Technorati Tags : ASP.NET, Visual Studio 2005, Microsoft
Hmm… I’m still getting this problem in VS 2008 Beta 2. 🙂
Hmm… I’m still getting this problem in VS 2008 Beta 2. 🙂
To restart IIS
Click Start, click Run type IISReset, and then click OK.
A Command Prompt window opens displaying the status of the IISReset command. You should read the status at the command prompt to make sure that IIS stops and restarts.
To restart IIS
Click Start, click Run type IISReset, and then click OK.
A Command Prompt window opens displaying the status of the IISReset command. You should read the status at the command prompt to make sure that IIS stops and restarts.
This made my day. Intellisense was back after following the instructions above, except for step 1. If I delete all the contents of my bin folder, all the references I made will be lost and will need to reference it all again.
Cheers
This made my day. Intellisense was back after following the instructions above, except for step 1. If I delete all the contents of my bin folder, all the references I made will be lost and will need to reference it all again.
Cheers
I went to DESIGN VIEW of the ASPX page, waited for a minute, then tried again. It worked! The problem happened on an AMB 64-bit laptop running 32-bit Vista, with a slow Video Driver. The Video Driver is the problem as it doesn’t let the VS 2008 to do the page parsing.
I went to DESIGN VIEW of the ASPX page, waited for a minute, then tried again. It worked! The problem happened on an AMB 64-bit laptop running 32-bit Vista, with a slow Video Driver. The Video Driver is the problem as it doesn’t let the VS 2008 to do the page parsing.
Man, you rock! Actually, just clearing the bin directory and the Temporary ASP.NET subdirectory did the trick for me. Not clear if I needed to clear the Temporary ASP.NET because the subdir under it in question was locked and I couldn’t delete it even after a VS 2008 shutdown. Started it back up and I’m good to go! Thanks, it’s great to be back in the saddle again!
Man, you rock! Actually, just clearing the bin directory and the Temporary ASP.NET subdirectory did the trick for me. Not clear if I needed to clear the Temporary ASP.NET because the subdir under it in question was locked and I couldn’t delete it even after a VS 2008 shutdown. Started it back up and I’m good to go! Thanks, it’s great to be back in the saddle again!