[CSharpBinding] Fixed potential System.InvalidOperationException