MethodInfo.Invoke called process: possible to stop run?

  • Thread starter Thread starter florian.grimps
  • Start date Start date
F

florian.grimps

Hi.

I'm trying to implement some kind of plugin manager and call functions
in remote loaded libraries in seperate AppDomains to be able to unload
the DLLs) via MethodInfo.Invoke(). So far, so fine. But I call some
long running functions this way an want to stop this calls, but have
no idea how to do this. Is it possible and how, or should I use a
different approach?

Thanks in advance,
Florian
 
Florian,

If your methods have no hooks in them which allow them to receive a
signal, then you will have to execute those methods in another thread, and
then abort the thread.
 
I'm trying to implement some kind of plugin manager and call functions
in remote loaded libraries in seperate AppDomains to be able to unload
the DLLs) via MethodInfo.Invoke(). So far, so fine. But I call some
long running functions this way an want to stop this calls, but have
no idea how to do this. Is it possible and how, or should I use a
different approach?

It's better to do this co-operatively, via a plugin interface which has
a method to tell the long-running tasks that you wish to stop. That way
they will be able to shut down gracefully, cleaning up resources etc.
 
Nicholas Paldino [.NET/C# MVP]
It's better to do this co-operatively, via a plugin interface which has
a method to tell the long-running tasks that you wish to stop. That way
they will be able to shut down gracefully, cleaning up resources etc.


The approach to use a plug-in interface to co-operatively
abort sounds good to me, I try to work this out.

Thanks a lot for your fast responses,
Florian
 
Back
Top