c# - System.Windows.Forms.Timer object does not tick when loaded from an activated assembly (plugin) -
i working on project loads assemblies (plugins) primary appdomain space (via reflection's assembly.loadfile() , activator class). part of api plugins, hosting application can request control-derived object display on host's form.
essentially: "hosting application" winforms application can load assemblies contain controls. hosting application loads assemblies (via assembly.loadfile()) , asks control each assembly. control rendered (added container) on form.
everything appears work fine (buttons, labels, images, etc.) control , interactive. however, if timer (winforms component - not system.threading.timer) used in form - not tick. if control used directly in host (when referenced dependency), timer tick expected.
is aware of problems winforms timer not being able hook message pump if loaded assembly?
it isn't clear "appdomain space" might mean. guessing: here's excellent blog post describes hazards of loading controls in secondary appdomain. key part one, followed advice on how make work:
windows forms supports isolating top-level windows via app domains. not support parent-child relationships across domains. many people have assumed because control derives marshalbyrefobject can remoted; not true. interfaces on control can remoted across domains, control’s api not support remoting. when see exceptions stating object cannot remoted because isn’t serializable, you’re seeing has tried cast remote proxy control.
Comments
Post a Comment