tags:

views:

97

answers:

4

EDIT: This question has been closed.

Apologies to all - my confusion was caused by the fact that my keyboard (an ancient IBM) has finally given up the ghost and was randomly delegating presses to other keys.

=== ** Original Erroneous Post ** === Is there some way of stepping through ForEach blocks e.g. when doing a straightforwad iteration through a List? The debugger seems to jumps straight over them.

My work around involves commenting out the .ForEach

and replacing with an old skool

for (...) 

block. Is there a proper solution to this?

A: 

Failure to reproduce. I often step through foreach() loops.
The 'jump straight over' behaviour sounds more like an empty loop.

Try to write a small Console App that demonstrates this, Post it and then we can talk further.

Henk Holterman
The question doesn’t mention `foreach()` loops at all.
Timwi
Right, I think the .ForEach() was missing in the first version.
Henk Holterman
A: 

Looks like whatever you are trying to iterate over is empty.

Johannes Rudolph
A: 

Check that your code hasn't been optimised away due to nothing happening in the loop. When encountering this sort of behaviour in the past i have inserted a Console.WriteLine(some property from iterated object) to ensure the code isn't optimised out by the compiler.

slugster
Better yet, compile in Debug mode without optimisations.
Timwi
A: 

Ignore me, I'm an idiot with a dodgy keyboard :-D

All sorted now, thanks for looking.

5arx
Please edit your original question, im not sure if everyone notices this post.
atamanroman