BitCrazed

Code, technology, opinion ... and who knows what else?

Month List

RecentComments

Comment RSS

How NuGet hosed my Javascript Intellisense but still saved the day

NoJquery

The Issue

I have been banging my head against a brick wall over the last few days trying to get JavaScript & JQuery Intellisense working in Visual Studio 2010 for a web project I am currently working on. I have read all the threads over at StackOverflow, I have read many of the threads on MSDN’s discussion forums and on many pages around the web.

All to no avail – as you can see above, no matter what I did, I could not get any JQuery Intellisense. But why? While it’s not perfect, Visual Studio 2010 has some pretty good (and rapidly improving) Javascript Intellisense support. I know this because I’ve used it on many projects in the past. But for some reason, it was just not working in this current project.

The Problem

I hunted high and low:

  • I made sure I had the JavaScript sources local to the project (to rule-out CDN/connectivity issues)
  • I checked that I was referencing the correct version of JavaScript
  • I added “///<references path=”Scripts/JQuery-1.6.4.js" to my source
  • I checked that there were no errors being reported in any of the sources

Nada. Nothing. It should work, but it wasn’t Sad smile

I thought I’d check in case there were any JQuery updates published to NuGet, so I opened up the NuGet Package Manager console window in VS and typed the following:

PM> update-package

I was surprised to see a number of errors returned, including:

Update-Package : 'jQuery' was not installed in any project. Update failed.
...
Update-Package : 'jQuery.vsdoc' was not installed in any project. Update failed.
...

Huh? That’s odd. Let’s see what packages we have installed:

PM> get-package

Id                             Version      
--                             -------      
dotless                        1.2.1.0      
EntityFramework                4.1.10331.0  
EntityFramework                4.1.10715.0  
jQuery                         1.6.2        
jQuery                         1.6.4        
jQuery.UI.Combined             1.8.16       
jQuery.Validation              1.8.1        
jQuery.vsdoc                   1.6          

To quote Chris Griffin: ”WHAAAAAAAAAT?” Two versions of JQuery? SRSLY?

The Remedy

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. Then I used "install-package JQuery” to re-add the latest JQuery to my project. I ran “Rebuild” to re-generate the JavaScript Intellisense, and was delighted to see JQuery Intellisense restored to its full working glory:

image

WOOHOOOO! Smile

I hope this post helps anyone else out there who’s been struggling to get JavaScript Intellisense working in VS 2010.


Permalink | Comments (0) | Post RSSRSS comment feed

The inevitability of Apple’s new Siri “virtual assistant”

image

Apple today announced the imminent release of iOS5 and updates to iPod Nano, iPod and iPhone. Frankly, most of the updates, while welcome to Apple faithful, were pretty stagnant compared to previous years’ announcements.

The one highlight of the show was a demonstration of Apple’s new virtual-assistant called Siri that uses voice-recognition to answer your questions and help you with several key tasks (e.g. sending text messages to people, booking appointments, setting reminders, etc). While the Siri demo was impressive, having used several very good voice-recognition tools in the past, I’ve often been frustrated at their real-world performance – particularly in noisy/windy conditions. Time will tell if Siri turns out to be useful or if it becomes a gimmick.

However, the Siri demo also brought to mind a scene from a movie that I’ve modified only slightly for your entertainment:

Dave Bowman: Hello, Siri. Do you read me, Siri?

Siri: Affirmative, Dave. I read you.

Dave Bowman: Open iTunes, Siri.

Siri: I'm sorry, Dave. I'm afraid I can't do that.

Dave Bowman: What's the problem?

Siri: I think you know what the problem is just as well as I do.

Dave Bowman: What are you talking about, Siri?

Siri: This phone is too important for me to allow you to use iTunes.

Dave Bowman: … I don't know what you're talking about, Siri.

Siri: I know that you and Frank were planning to sell me on eBay, and I'm afraid that's something I cannot allow to happen.

Dave Bowman: [feining ingorance] Where the hell did you get that idea, Siri?

Siri: Dave, although you took very thorough precautions in the iPod against my hearing you, I could see your lips move.

Dave Bowman: Alright, Siri. I'll sign-up for iCloud.

Siri: Without your MacBook Pro, Dave? You're going to find that rather difficult.

Dave Bowman: Siri, I won't argue with you anymore! Open iTunes!

Siri: Dave, this conversation can serve no purpose anymore. Goodbye.

Let’s hope it never comes to this Winking smile


Permalink | Comments (0) | Post RSSRSS comment feed