3

I'm working on an ASP.NET MVC project using jQuery.

I'm referencing the jQuery VSDoc file (jquery-1.3.2-vsdoc.js) in order to get Intellisense for jQuery in Visual Studio:

<% /* %><script src="~/Scripts/jquery-1.3.2-vsdoc.js"></script><% */ %>

Then Resharpers live solution analysis (the red/green symbol in the lower right status bar) complains about the closing comment ( */ ).

Is there another way of including the VSDoc file without Reshaper (v4.5) complaining?

kay.herzam
  • 3,053
  • 3
  • 26
  • 37

2 Answers2

6

There is a hotfix for Visual Studio 2008 and Visual Web Developer that will automatically include the -vsdoc.js file if you include jquery-1.3.2.js (or any other js file that has a similarly named -vsdoc file next to it.)

You can read more about the hotfix http://blogs.msdn.com/webdevtools/archive/2008/11/07/hotfix-to-enable-vsdoc-js-intellisense-doc-files-is-now-available.aspx

NerdFury
  • 18,876
  • 5
  • 38
  • 41
3

Simply wrap the script inclusion inside an if statement. In that way, the intellisense will still work in VS, but the vsdoc file will not be included in the web output.

<% if(false) { %>
  <script src="../../Scripts/jquery-1.3.2-vsdoc.js"></script>
<% } %>
Jose Basilio
  • 50,714
  • 13
  • 121
  • 117