I recently ran into a little issue that I would almost call a bug in Visual Studio 2008.
Technically my code ended up being the issue, however the error VS gave me was very misleading.
I had a method with two input parameters which were used throughout the method.
about 2/3 rd's of the way through I accidentally put this line
essentially I referenced an attribute on a custom object without using the value for anything and without ending the line with a semicolon (C#). I received this error and almost every instance of my parameter variables were underlined with it:
"Cannot use local variable [variablename] before it is declared".
My problems with this error were:
1. it is completely false.
2. with every variable highlighted I forgot about my bad line and set about figuring out what the issue could be towards the top of my method to cause such a bad problem.
3. Normally VS will keep missing ; errors constrained to the errant line and the one following it, this time it said there was an error in lines far above where the actual error was.