What is the _references.js file used for in a new ASP.NET MVC 4 project?
Asked
Active
Viewed 6.4k times
3 Answers
268
In VS 11, Visual Studio will give you intellisense from all files that have references in the “_references.js” file.
-
10I didn't even appreciate why I was getting angular intellisense. <3 Visual Studio! – Dave Alperovich Apr 03 '14 at 17:50
-
4Yes, but where is "_references.js" referenced from? – Pap Jan 25 '19 at 10:38
23
MSDN documentation: JavaScript IntelliSense
In brief, _references.js stores the list of JS files paths, for which you want the Visual Studio to gather and build the intelisense (aka "code complete"). The VS project adds there some common JS libraries like jQuery to build the intellisense for it. You can add a reference to your custom JS file in form like this:
/// <reference path="MyScriptFile.js" />

Dmitry Pavlov
- 30,789
- 8
- 97
- 121
-
2In my experience, usage by Visual Studio (2017) has grown beyond just intellisense. I found that if, for example, `jquery-2.2.2.min.js` was not mentioned in `_references.js`, then it wouldn't get deployed and there would be a run time failure using jquery. – Kit Jul 21 '17 at 09:11
-