Skip to content Skip to sidebar Skip to footer

Jquery Ui Breaks Visual Studio 2015 Intellisense

I am finding a frustrating issue with JavaScript intellisense where if I include jQuery UI in my _references.js file I lose all JavaScript intellisense. Does anyone know if there i

Solution 1:

For those who experience this issue, I found that using jQuery 3.x was causing instellisense to break when jQuery UI was included in _references.js. My solution was using NuGet to change back to version 2.2.4 and everything started to work fine again.

Solution 2:

I've got the same problem. I tried quite a few things but the only thing I could get to consistently work was to disable the auto sync feature and remove the jquery UI reference. Intellisense also seems to slow down a good bit with more and more libraries, almost to the point it looks like it is not working. I finally just got to the point where I only include my own scripts and jquery for helpful reminders on syntax. Unfortunately this means I have to manually keep the _references.js file up to date but it's definitely better than it not working at all.

You can also limit your global references in the _references file and drag the script files that you want intellisense for to each view if you are like me where you have a script file for each view. That way you don't get intellisense for scripts that aren't even rendered to the view.

Solution 3:

not sure if this will help you but have you added this to the top of your .js file?

/// <reference path="/scripts/jquery-3.1.1.js" />

that's the path that's made if you you've used NuGet to install jquery for your solution. If you've located your jquery file and intellisense file elsewhere use that path instead (I do believe they need to be in the same folder).

Solution 4:

I found a better solution! Simple rename jquery-ui-1.12.1.js (or similar) to _jquery-ui-1.12.1.js. This will cause it to appear at the top BEFORE the conflicting jQuery 3 references in the _references.js file that cause intellisense to not work. Be sure to also update any script tag or BundleConfig.cs references you have to include the new underscore character prefix!

Solution 5:

Answer :

In your _references.js file:

  1. Move the JQuery-UI reference above the main JQuery reference
  2. Disable auto-sync

such as:

///<autosync enabled="false" />///<reference path="jquery-ui-1.12.1.js" />///<reference path="jquery-3.3.1.js" />

Drawbacks:

  • You will have to repeat step 1 every time you Update JavaScript References (right-click on _references.js to update references in Visual Studio).

Post a Comment for "Jquery Ui Breaks Visual Studio 2015 Intellisense"