Hi,
I am stuck with an InvalidCast Exception. I am calling a delegate to run some function. In the callback method of the delegate I am trying to get the return value of the function as shown below.
public delegate SyncHelper.SyncPlan RunJobDelegate();
public static void SyncJobCallback(IAsyncResult result)
{
RunJobDelegate runSyncJob = (RunJobDelegate)result.AsyncState;
SyncHelper.SyncPlan obj_Plan = runSyncJob.EndInvoke(result);
When RunJobDelegate runSyncJob = (RunJobDelegate)result.AsyncState; is called I am hitting an exception saying "Unable to cast object of type 'RunJobDelegate' to type 'RunJobDelegate'. "
Please help me with the solution if anyone has seen this before.
Divya.