quote:
Originally posted by TazDevil
hey J-Thread
i have an article for you to study about C# plugins although i dont understand much of it, cause i dont have time to learn how C# works, so, i thought to pass it on to you, you should understand better...
Anyways, in this article it says that
quote:
Does your app need to unload or reload plug-ins while it's running? Does your app need to control the security access that plug-ins have to files and other resources? If you answer yes to either question, you'll need AppDomains.
In the .NET Framework, there's no way to directly unload an assembly. The only way is to load the assembly into a separate AppDomain, then unload the whole AppDomain. Each AppDomain can also have its own security permissions. AppDomains provide a processing unit with the isolation usually afforded by separate processes, without the overhead, and multiple AppDomains can exist within the same process. AppDomains are typically used in server apps, where the server runs 24/7 or nearly so, and needs to load and unload components on the fly without restarting. AppDomains are also used to limit the permission that plug-ins are granted, so that an application can load untrusted components without fear of them doing something malevolent. To enable this isolation, using multiple AppDomains requires remoting; objects in different AppDomains can't call each other directly, they must be marshaled across the AppDomain boundary. In particular, shared instances of classes must derive from MarshalByRefObject.
So right now heh you cannot unload/reload C# plugins unless you build them in such a way and Plus is developed in such a way
And i would suggest to you to work with Patchou and pass this article to him, if the implemetation of this kind works, maybe you could work it out
Check the article here, and tell me if it works for you....
Article Link
Also read http://blogs.msdn.com/jasonz/archive/2004/05/31/145105.aspx
That probably could be linked to why you cant load more than 1 C# plugin...
Wierd enough your dll doesnot show in the loaded modules list althought the actual plugin is loaded in plus! Only the .Net framework files are loaded ...
Hey,
Curious that I read this article yesterday and it illuminated me! I finally found a way to unload/load a C# plugin
The solution is to unload the appdomain of your plugin like this (if you're executing code in your plugin, otherwise you have to find you plugin appdomain and unload it): AppDomain.Unload(AppDomain.CurrentDomain);
Maybe I'll do a simple plugin tomorrow or the day after tomorrow because now I'm getting an alpha version of a plugin I'm developing for plus