jqueryvisual-studio-2008intellisensevsdoc

Is it possible to use a content delivery network for Intellisense in Visual Studio 2008?


As I understand it, you should be able to (with KB958502 installed) get Intellisense for jQuery simply by referencing the script (as long as the -vsdoc version is alongside).

We'd quite like to use a CDN for distributing this, but simply adding:

<script language="javascript" type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.js"></script>

Gives an obscure warning

Warning 1 Error updating JScript IntelliSense: C:...\Temporary Internet Files\Content.IE5\4U5FWPZF\jquery-1.7.1-fds901..js: Object doesn't support this property or method @ 1352:1 c:\Projects...\MyFile.aspx

At a guess, I'd assume that it's "having a sulk" because the file name in the cache isn't of the form jquery-1.7.1-vsdoc.js, especially as the error remains the same, even if I go the whole way with:

<script language="javascript" type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.js"></script>
<script language="javascript" type="text/javascript">
 // This is for jQuery intelisense:
 /// <reference path="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1-vsdoc.js"/>

 $(function() {
  // My other code...
 });

</script>

This still doesn't work.

Is it simply the case that vsdoc Intellisense does not work with remotely hosted files?


Solution

  • I don't think that it's possible, at least without any 3rd party tools or complex hacks ( I don't know of any ). What I've always done in the past is download jquery and from your js files you can add

     /// <reference path="Scripts/jquery.js"/>
    

    for intellisense, but in your pages, get the library from the CDN. Just because the script is referenced in your js does not make the browser download this, so you will only be getting the script from the cdn when running.