@lasr,
Make sure you are changing Invoke Code activity Language property to CSharp
Invoke Code
Language