¿Frequent VS 2010 es muy lento y falla en una solución/archivo específico?
Frecuentes
Visto 62 veces
0
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).
¿Alguna idea de cómo solucionarlo?
1 Respuestas
0
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 visual-studio-2010 c#-4.0 lambda crash or haz tu propia pregunta.