Monthly Archives: June 2013

Javascript Intellisense in Visual Studio 2012

After years of use, I tend to accumulate a lot of cruft on my work computer hard drives, so whenever I replace a machine or hard drive I like to start fresh and only pull down old files from the backup server as I need them.  Last week, I replaced the hard drive on my laptop, so I had to redo all of the settings on Visual Studio.  As I had forgotten how to do this, I figured I should write it down to help me next time… perhaps it will help you too?

When developing Visual Studio MVC projects, if you’re like me, you like to move directories around to make more sense of the layout (instead of the default structure that M$ gives you).  An example of this is creating a public directory to hold your publicly available files, like styesheets and scripts.  You’ll also notice that when you move your Javascript libraries, Intellisense breaks.  This happens whenever the _references.js file is moved from its expected location*.

To fix, simply go to Tools | Options | Text Editor | JavaScript | IntelliSense References.  Switch to the Implicit (Web) Reference Group and add a new reference that resolves to the new location of the _references.js file:

VSJSOptions

Note that if you want to use a path relative to your project, it has to be entered into the text box at the bottom, in the form of “~/whatever_dirs_below_project_root”.

* If you want Intellisense support for your Javascript libraries, you need to be sure that the library name is included in the _references.js file.  This is not all, however.  VS also needs a vsdoc.js file that provides the particular data needed by Visual Studio Intellisense (e.g. jquery-1.10.0-vsdoc.js supports jquery-1.10.0.js).  Note that you should NOT include the vsdoc file name in the _references.js file, just the main file.  Intellisense vsdoc files for jquery are available on the ASP.NET CDN at http://www.asp.net/ajaxlibrary/cdn.ashx.

Don’t buy stuff from the Microsoft Store… ever

I consider myself a pretty reasonable guy.  I try to be polite to everyone and slow to get angry, and it is definitely out of character for me to write about a bad experience.  But the jokers at Microsoft’s online store made me do it…

I just wanted to give you some advice that will save you heartache later on: don’t buy stuff from the Microsoft Store… ever.

Back on May 23, I ordered a Microsoft Surface Pro from the online store for my son, who wanted it for college classes this summer.  The website didn’t give any indication it was out of stock, back-ordered, etc., so I thought this would be the easiest way for me.  Fine, I ordered it and paid for next day shipping.  Now understand, there is Microsoft kiosk at a mall just 15 miles from my house, so I did this thinking it would save me time and a trip.  Boy, was I so wrong on both counts.

Fast forward to May 28th.  My son is starting class on the following day and still no Surface.  So, I called store support and talked to Gail who told me that the order was still pending.  Her explanation was that there was a problem with my credit card?!?  Now, I pay off my credit cards every month… this is obviously not the problem. Whatever. I asked her to just cancel my order and I would go to the kiosk to buy one.  After a few minutes of convincing her that I really wanted to do this, she says the order was canceled.  I then went down to the kiosk that night with my wife and picked up a Surface (with the same credit card I used for the online order, no less).

Problem solved… or so I thought.

I get an email today… TODAY, June 12th telling me:

Thank you for ordering from Microsoft. At your request, we attempted to cancel the following products from your order. Unfortunately, we were unable to stop shipment and you will be charged for these items.

Really? TWO WEEKS after I canceled my order, you can’t stop a shipment from happening?  So now I have to spend even more time, being a jerk to people that are just trying to do their job.

Wonder why people give Microsoft a bad rap?  I’d say they earn it all by themselves.

T

P.S.  Sorry to make you endure this rant on a technical blog.  I just needed somewhere to vent.  I’m off to dispute the charge.  Thanks for reading.