Navigation: X# Documentation > X# Compiler Errors and Warnings
Error XS8186
A foreach loop must declare its iteration variables.