You can consider MEF from Microsoft. It is a composition engine that can be set up to monitor a local folder and automatically load assemblies that export parts (implementation of IReport in your case) that you're interested in. We do have a system like that we implemented sometime ago. We have a single assembly with reports that we load into a separate application domain and reload if the file version has changed. Then we use .NET remoting to communicate between app domains. We considered using Add-in framework from Microsoft but we found it to be very complex and imposing and decided it was too heavy and complex in our case.
A:
Mehmet Aras
2009-05-12 10:37:48
Thanks, will take a look.
SeasonedCoder
2009-05-12 10:45:33
+1
A:
Have a look at Mono.Addins (it's MIT license so it's ok with closed software). From your description it does what you need. Basically it uses a dependency tree + plugins based on interfaces. It has it's own manager for loaded .dll-s and its objects are based on the loaded interface, so you don't need any more magic casting to call anything.
viraptor
2009-05-12 11:03:58
Thanks for the link, viraptor. Seems to be a really good source of information. Still, I would like to implement smth on my own (not-invented-here syndrome?) just for experience.
SeasonedCoder
2009-05-13 02:32:04
A:
This developer fusion article gives you all the code you need to use plug-ins
http://www.developerfusion.com/article/4371/writing-pluginbased-applications/
It's based on reflection.
Adam Pope
2009-05-12 11:08:34
+1
A:
See this: http://stackoverflow.com/questions/835551/problem-with-dynamic-loading-of-a-dll-into-my-program Is doing exactly what you want wihtout all the YAGNI around it.
gbianchi
2009-05-12 12:05:53
Thanks, gbianchi. The "Dynamic Loading with Reflection" article is really helpful.
SeasonedCoder
2009-05-13 02:34:06