Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > API Authentication >

Unable to cast IToken to type

Started by Dryrun Team -   in API Authentication

I am using the .NET SDK and I get this error frequently:

Unable to cast object of type 'DevDefined.OAuth.Framework.TokenBase' to type 'Xero.Api.Infrastructure.Interfaces.IToken'

It seems as though because I have two different references in my application for IToken, Xero seems to be confusing the two. This error happens INTERMITTENTLY and seems to go away on its own - which has made it so there is no permanent solution to the problem.

Has anyone else run into this?