My Visual Studio 2010 always slows down or crashes when working with a specific solution. And by slow, I mean SLOW! For example, I can type in 4-5 characters per minute. And usually the UI freezes, and sometime ultimately crashes down. So, basically I can’t work with the solution. I tried these solutions with no effect:
- Disabling and uninstalling all extentions.
- Removing .suo, bin, and debug folders
- Disabling IntelliSense, text editor options,…
- Rebooting the system
- Trying it on different computers with same versions of VS and Windows (7).
Any idea on how to fix it?
So, after hours of trying out everything, I figured out that the crash happens when working on a specific file. Particularly, the issue was with this line of code:
Apparently, since the line uses many lambda expressions, the VS parser cannot handle it efficiently, though it is a syntactically and semantically correct expression, and it’s compiled and executed correctly.
Solution: Remove or comment the line, and use a set of shorter expressions to perform the same functionality. I just used some nested foreachs to replace the expression.