Visual Studio 2012 JavaScript Intellisense Not Working

前端 未结 6 2153
一个人的身影
一个人的身影 2021-01-03 23:01

I have Visual Studio 2012 installed on my laptop and desktop. On my desktop PC, the JavaScript intellisense is not working. For any method it pulls up (even standard JavaS

6条回答
  •  我在风中等你
    2021-01-04 00:00

    I had the same problem: in Visual Studio 2010 I was used to add a reference in my javascript files, at the top, like this:

    /// 
    

    With the new Visual Studio 2012 this was not working anymore, I looked around and found the solution to put the reference in /scripts/_references.js I did so, not working.

    What I was doing wrong was that I was referencing the vsdoc.js file, or at the moment of writing, nuget downloaded jquery 1.9.1 package, reference to jquery-1.9.1.intellisense.js which is WRONG.

    The correct reference (if using the /scripts/_references.js file) is:

    /// 
    

    (NOT the .intellisense.js or the -vsdoc.js file).

    For the global solution to work on all your projects: copy all the jquery files (main, minified, map, and intellisense one, to be sure) in C:\Program Files (x86)\Microsoft Visual Studio 11.0\JavaScript\References (adapt the path if you installed Visual Studio 2012 somewhere else) and in Visual Studio, under Tools > Options > Text Editor > Javascript > Intellisense > References > Add a reference to jquery-1.9.1.js (again, NOT the vsdoc or intellisense file, but the main one) as explained in the solution by denas (but it was not clearly said not to point the vsdoc/intellisense file).

    Hope this helps.

提交回复
热议问题