¿Frequent VS 2010 es muy lento y falla en una solución/archivo específico?

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:

  1. Disabling and uninstalling all extentions.
  2. Removing .suo, bin, and debug folders
  3. Disabling IntelliSense, text editor options,...
  4. Rebooting the system
  5. Trying it on different computers with same versions of VS and Windows (7).

¿Alguna idea de cómo solucionarlo?

preguntado el 28 de agosto de 12 a las 14:08

1 Respuestas

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:

d = sd.Categories.Max(cat => cat.Subcategories.Max(d => d.Data.Where(a => a.CountryName != "World" && a.CountryName!="Asia Pacific").Max(a =>  a.AnnualData.Max(ad => ad.Value)));

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.

Respondido 28 ago 12, 14:08

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.