T
trullock
Hi,
Here's my problem, hopefully someone can suggest a suitable
solution
I've got a large web application project, in which i want to create a
sort of plugin architecture.
I'm going to need to requently add new usercontrols, which all
implement the same Interface. These controls will be loaded onto a
page and the methods defined in the interface will be called to make
the control do things.
My problem is that I'm going to need to create these new controls more
frequently than I'm able to publish the site as a whole.
Is there some way i can publish the controls separately, then upload
the ascx to some plugin folder and drop a dll in the bin? I'm planning
on having some database table of control names so i know what control
are available (thats where ill get the name from to load).
Here's what ive managed so far:
I've built a servercontrol in a separate assembly and i can load it in
like this:
AppDomain dom = AppDomain.CreateDomain("SeparateAssembly",
AppDomain.CurrentDomain.Evidence,
AppDomain.CurrentDomain.SetupInformation);
Assembly asm = dom.Load("SeparateAssembly");
object o = asm.CreateInstance("SeparateNamespace.MyPluginControl");
this.Page.Controls.Add((Control)o);
And thats all gravy i suppose, but I'm stuck as to how to let the
website assembly know that my loaded object implements some interface
(plus i cant actually code MyPluginControl to implement the interface
because its in a different assembly!)
Am i going down the wrong route, is what im attempting even possible
(or sensible)?
What are my options?
Thanks
Andrew
Here's my problem, hopefully someone can suggest a suitable
solution
I've got a large web application project, in which i want to create a
sort of plugin architecture.
I'm going to need to requently add new usercontrols, which all
implement the same Interface. These controls will be loaded onto a
page and the methods defined in the interface will be called to make
the control do things.
My problem is that I'm going to need to create these new controls more
frequently than I'm able to publish the site as a whole.
Is there some way i can publish the controls separately, then upload
the ascx to some plugin folder and drop a dll in the bin? I'm planning
on having some database table of control names so i know what control
are available (thats where ill get the name from to load).
Here's what ive managed so far:
I've built a servercontrol in a separate assembly and i can load it in
like this:
AppDomain dom = AppDomain.CreateDomain("SeparateAssembly",
AppDomain.CurrentDomain.Evidence,
AppDomain.CurrentDomain.SetupInformation);
Assembly asm = dom.Load("SeparateAssembly");
object o = asm.CreateInstance("SeparateNamespace.MyPluginControl");
this.Page.Controls.Add((Control)o);
And thats all gravy i suppose, but I'm stuck as to how to let the
website assembly know that my loaded object implements some interface
(plus i cant actually code MyPluginControl to implement the interface
because its in a different assembly!)
Am i going down the wrong route, is what im attempting even possible
(or sensible)?
What are my options?
Thanks
Andrew