views:

547

answers:

2

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?

+3  A: 

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
Copy. Paste. Works!Thank you!
kay.herzam
The hotfix solution proposed by NerdFury works excellent, so no need to include -vsdoc Javascript in every page or control.
Ronald Wildenberg
Unfortunately I cannot install the hotfix everywhere. At some sites I'm working with "managed" PCs, where you're not allowed to install any software.
kay.herzam
+6  A: 

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
Thanks for the link, good to know it's also working with my own .js files.
kay.herzam
I installed the hotfix, however it's not working.
kay.herzam