9

I just opened my ASP.NET site / project in VS 2013. I noticed (maybe they were there in VS 2012, too, but I paid no attention to it), that I get this in the Output window:

07:20:45.5493: Referenced file 'jquery-1.8.2.js' not found.
07:20:45.5512: Referenced file 'jquery-ui-1.8.24.js' not found.
07:20:45.6332: Referenced file 'knockout-2.2.0.debug.js' not found.
07:22:11.0550: Referenced file 'jquery-1.8.2.js' not found.
07:22:11.0550: Referenced file 'jquery-ui-1.8.24.js' not found.
07:22:11.0570: Referenced file 'knockout-2.2.0.debug.js' not found.

It's true, I reference jQuery using a CDN, and a newer version than 1.8.2, so I don't need a reference to that version. But where does my project say that it needs it? I did a solution-wide search, and the only reference (no pun intended) to it was in _references.js, which contains this:

/// <reference path="jquery-1.8.2.js" />
/// <reference path="jquery-ui-1.8.24.js" />
/// <reference path="jquery.validate.js" />
/// <reference path="jquery.validate.unobtrusive.js" />
/// <reference path="knockout-2.2.0.debug.js" />
/// <reference path="modernizr-2.6.2.js" />

So the output window's complaints and what's in _references.js partially coincide. So: how is _references.js used? Should I remove the contents of the file? Remove the named files from my Scripts folder, since they're not being used, or what?

B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
  • does your project itself have a reference to the files, that don't exist on disk? I.e., do you have a scripts folder that have those files in them, but they appear in Visual studio with a warning icon over them? If you can't find that, try opening your project file in a text editor like notepad++ and searching for the file names there. – xdumaine Oct 18 '13 at 15:13
  • 1
    According to http://stackoverflow.com/a/10319726/227646 > In VS 11, Visual Studio will give you Intellisense from all files that have references in the “_references.js” file. – kush Oct 18 '13 at 15:14
  • @xdumaine: I do have a lot of those files (probably all; I'm not at that machine right now) in my Scripts folder, seeing no reason to delete them, even though I'm not using them... – B. Clay Shannon-B. Crow Raven Oct 18 '13 at 18:26

2 Answers2

9

It is not something to worry about unless you want code insight for your JS.

To fix it, place all the mentioned missing Referenced JS files into the same folder as your _references.js file. Most likely found in your ~/Scripts folder.

The other alternative is either remove those file names and paths from the _references.js file or update those references to point to the correct paths.

For more detailed information check Mads Kristensen blog

Andrew Marais
  • 925
  • 9
  • 13
1

After I removed jquery.validate.unobtrusive.js manually, I saw the error: "Referenced file 'jquery.validate.unobtrusive.js' not found." (In the Output window for Javascript Language Service)

I didn't find adjusting _references.js helped.

When I uninstalled the related knockout package using 'Manage NuGet Packages', the error disappeared.

Walter de Jong
  • 1,565
  • 2
  • 12
  • 17