Navigation: X# Documentation > X# Compiler Errors and Warnings
Error XS7006
Expressions and statements can only occur in a method body