Realtime Remove plugin Asp.Net MVC 5

May 16, 2014 at 9:13 AM
Hello I am testing your plugin solution in my Asp.Net MVC5 app but I have following problem:
When I Call BundleRuntime.Instance.Stop() is Called Stop methods of Plugin (IBundleActivator) but Plugin Folder cannot be removed. Dll files are locked. I tried Boostrapper.RestartAppDomain(); and System.Web.HttpRuntime.UnloadAppDomain(); but without effect

Could you help me?

Filip
Coordinator
Jun 6, 2014 at 8:01 AM
No, you cannot remove any dlls on realtime unless completely restart the application, since OSGi.NET loads all dlls under only one App Domain.

BTW, Stop() and Uninstall() both do not mean physically "REMOVE", they are used to change the status (and save the status in a persistent.xml, side by side with Manifest.xml) in plugin life-time management.

Boostrapper.RestartAppDomain() will restart ASP.NET App Domain and BundleRuntime, if you Uninstall() the plugin before RestartAppDomain(), this plugin will be removed automatically, but if you Stop() the plugin before RestartAppDomain(), BundleRuntime will only load it when this plugin must be loaded, e.g. some other plugins that will be started normally also depend on it.