Could not load type 'Invalid_Token.0x02000000' from assembly ']0987654RE3W23SD, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

Viewed 1021

I'm getting this error in controller while trying to fetch data via viewmodel :

"Could not load type 'Invalid_Token.0x02000000' from assembly ']0987654RE3W23SD, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'."

Does anyone have any idea what this might be and how to overcome it?

1 Answers

Just had this error occur, I fixed it by removing an alias I had assigned to the using directive for the Type that was throwing the error:

Before:

using MyAlias = My.Namespace.Chain
[...]
MyAlias.MyObject myObject = MyGenericMethod<MyAlias.MyObject>(); // Exception thrown here
[...]

After:

using My.Namespace.Chain
[...]
MyObject myObject = MyGenericMethod<MyObject>(); // Exception no longer thrown
[...]

I know this thread is super old now, and you've probably solved it, but hopefully it'll help someone in the future.

Related