My code won't compile with this error:
Embedded statement cannot be a declaration or labeled statement
This doesn't compile:
for (int i = 0; i < 10; i++)
DateTime xs = DateTime.Now;
but this does:
for (int i = 0; i < 10; i++)
{
DateTime xs = DateTime.Now;
}
MSDN only explains the fact but not the reason why.