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
withint
to prevent data type casting.