Unable to cast object of type Telerik.OpenAccess.RT.OID.LongIdentity to type Telerik.OpenAccess.IObjectId

Thread is closed for posting
2 posts, 1 answers
  1. Ramya
    Ramya avatar
    8 posts
    Member since:
    Nov 2009

    Posted 28 Jul 2010 Link to this post

    I am seeing the below exception when calling GetObjectId on a scope object within a transaction after adding a newly created object to the scope, which did work fine before. I see no changes made to the entity class (the instance of which is getting added to scope) for quite some time.

    System.InvalidCastException was caught
      Message=Unable to cast object of type 'Telerik.OpenAccess.RT.OID.LongIdentity' to type 'Telerik.OpenAccess.IObjectId'.
           at Telerik.OpenAccess.RT.ObjectScope.GetObjectId(Object pc)

    Any idea what might be causing this?

  2. Answer
    Thomas avatar
    590 posts

    Posted 29 Jul 2010 Link to this post

    Hi Ramya,

    could it be that in your application you are using two versions of OpenAccess? I'm asking this because the LongIdentity type is derived from IObjectId, and a cast can then only fail if IObjectId != IObjectId and this could be caused by two versions of OpenAccess beeing used by your application.

    All the best,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top