< class="prominent-subhead ">

An error occurred in the ConnectService Service Instance. Invalid cast from 'System.Byte' to 'System.SByte&'.

This article was created in response to a support issue logged with K2. The content may include typographical errors and may be revised at any time without notice. This article is not considered official documentation for K2 software and is provided "as is" with no warranties.
This article has been archived, and/or refers to legacy products, components or features. The content in this article is offered "as is" and will no longer be updated. Archived content is provided for reference purposes only. This content does not infer that the product, component or feature is supported, or that the product, component or feature will continue to function as described herein.


After upgrading an environment from K2 4.6.8 to K2 4.7, one of the SmartObjects which is using K2 Connect Service Object, shows an "Invalid cast from System.Byte to System.Sbyte&" error.



The following symptoms appear:
  • From Test Cockpit, the bapi executes fine and returns the results correctly
  • From the Service Object Design, there are properties in System.SByte type.
  • From SmartObject Tester Tools, the same properties are being recognized as a Number.
  • After executing the Smart Object the error appears: Invalid cast from 'System.Byte' to 'System.SByte&'.


Please log a ticket with K2 Support referencing this KB article to request the fix.