Skip to main content

SystemInvalidCastException occurs when using SByte together with int

This issue may be caused to SByte not meeting the requirements for CLS compliance and causes issues when casting from int.

Possible solution:

  • Replace SByte with int to prevent data type casting.