I am going to outline the problem I was seeing and post the answer to the problem immediately afterwards because I’ve seen several threads discussing this issue but none that have presented the remedy I found this morning.
I am using Visual Studio 2010 to build a web project but cannot get any JQuery intellisense. I do get some basic JavaScript Intellisense, but specifically get no JQuery Intellisense.
I’ve done all the recommended troubleshooting – making sure I have JQuery locally to rule-out CDN/connectivity issues, making sure I’m referencing the correct JQuery files, etc. But to no avail – still no JQuery Intellisense 🙁
Here’s the solution to the issue above:
To cut a long story short, I used the NuGet Package Manager pane in VS2010 to run update-package in case something was wrong with the local JQuery package, and was surprised to find a number of errors reported:
That’s odd. Let’s see what packages we have installed:
Notice that I appear to have multiple JQuery packages installed. This is likely confusing Visual Studio’s Javascript Intellisense engine.
I remembered that just a couple of weeks ago, I’d updated my NuGet packages and noticed that a new version of JQuery had been downloaded, the old version appeared to be removed from my project and replaced with JQuery-1.6.4. I thought it had been done right, but I guess something must have gotten screwed up in the upgrade.
So, I used “uninstall-package …” several times for each JQuery library until all references to JQuery were removed.
I then used “install-package JQuery” to re-add the latest JQuery to my project. I “Rebuilt” the project to re-generate the JavaScript Intellisense, and was delighted to see JQuery Intellisense restored to its full working glory!
This issue and its resolution is also documented on my blog:
http://www.bitcrazed.com/post/2011/10/07/How-NuGet-hosed-my-Javascript-Intellisense-but-still-saved-the-day.aspx
Hope this helps others who’re having problems getting JQuery Intellisense working in Visual Studio 2010.