Sune Foldager
9/9/2008 7:07:00 AM
Hello Pavel,
> If you're looking for a quick temporary workaround (assuming that
> creatively rearranging code didn't work), consider using
> MethodImplAttribute with MethodImplOptions.NoOptimization on the
> offending method.
Thanks, I didn't know about that one. Actually, creatively rearranging does
work, and it's quite easy to get the problem to disappear. For instance,
there is a foreach(var a in b) somewhere, which has a rather large body in
the original, unreduced, code. By simply iterating with foreach, over b,
one time, copying all elements to a fresh List<T>, and then iterating over
that List<T> in the large foreach, the problem disappears :-). There are
many other similar cases.
-- Sune.