Hi,
Can you post the details of event, that occurs the error. it seems to casting problem, i suggest if you know the event causing the error, create trace file in your application and set flag to 1 to record all trace error, and post the trace log file.
Happy coding.