this.Invoke((MethodInvoker)delegate
{ code;
});
This results in exception as
Cannot access a disposed object. Object name: '...'.
How to handle this??
this.Invoke((MethodInvoker)delegate
{ code;
});
This results in exception as
Cannot access a disposed object. Object name: '...'.
How to handle this??
InnerException
property of TargetInvocationException contains information you need to investigate (see Reflection MethodInfo.Invoke() catch exceptions from inside the method for sample).
In your case it looks like you are accessing some disposed objects (like closed streams) in your delegate. Not much to do with Invoke itself.