Since this is a different "answer" than my last, I am creating another post/entry.
I did experience this from time to time on a project I was on last year. I was using MochiKit as my toolkit, so take that into consideration.
Basically, I had some code like this in a file called common.js, which ran in the global scope:
if(typeof(DomEvent) == "undefined") {
DomEvent = {};
var domEventNames = [
"onabort", "onblur", "onchange", "onclick", "ondblclick", "onerror", "onfocus",
"onkeydown", "onkeypress", "onkeyup", "onload", "onmousedown", "onmousemove",
"onmouseout", "onmouseover", "onmouseup", "onreset", "onresize", "onscroll",
"onselect", "onsubmit", "onunload"
];
// forEach is a MochiKit function; functionality should be obvious
forEach(domEventNames, function(eventName) {
DomEvent[eventName] = eventName;
});
}
So, it basically dynamically builds an object assigned to the variable DomEvent
and creates properties on that object that are have the same name as the value it holds (string representations of common browser events).
Now, I wanted Intellisense to help me with the API in other files, so in other files, I would have the following line in the top of the file:
/// <reference path="common.js"/>
That tells Visual Studio to "import" the API from that JavaScript file for use with Intellisense in the file this declaration is used in.
So I speculated that since the code in the common.js file, which I showed above, was building a global variable's value dynamically, Visual Studio was barfing on it. I felt fairly good about this hypothesis because the JavaScript code itself is sound, and Visual Studio would only crash if I used that XML comment to assist Intellisense. If I removed it, there wasn't a problem.
Hope that helps you or someone else.