This is a migrated thread and some comments may be shown as answers.

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

1 Answer 90 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ramya
Top achievements
Rank 1
Ramya asked on 29 Jul 2010, 04:47 AM
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'.
  Source=Telerik.OpenAccess.Runtime
  StackTrace:
       at Telerik.OpenAccess.RT.ObjectScope.GetObjectId(Object pc)


Any idea what might be causing this?

Thanks,
Ram

1 Answer, 1 is accepted

Sort by
0
Accepted
Thomas
Telerik team
answered on 29 Jul 2010, 08:09 AM
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,
Thomas
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
Tags
Development (API, general questions)
Asked by
Ramya
Top achievements
Rank 1
Answers by
Thomas
Telerik team
Share this question
or