Override Data Access from Database

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 years ago
Hi...
I have created a Plugin to override Category access from my Local Database. Instead of that I am using solr source.
At first it was working fine after installation of plugin. But after sometime I uninstalled plugin but then also it is invoking my plugin override method.
5 years ago
Your plugin's DependencyRegistrar is called and service registrations are done, no matter if the plugin is installed or not. It's therefore better to either delete the plugin or check if the plugin is installed within your DependencyRegistrar file before you replace the registrations.


var pluginFinderTypes = typeFinder.FindClassesOfType<IPluginFinder>();

            bool isInstalled = false;

            foreach (var pluginFinderType in pluginFinderTypes)
            {
                var pluginFinder = Activator.CreateInstance(pluginFinderType) as IPluginFinder;
                var pluginDescriptor = pluginFinder.GetPluginDescriptorBySystemName("<Your plugin system name>");

                if (pluginDescriptor != null && pluginDescriptor.Installed)
                {
                    isInstalled = true;
                    break;
                }
            }

            if (isInstalled){ // perform the registrations}

Hope that helps.
Best Regards,
Anshul
5 years ago
Thanx Anshul..... Now it is working fine...
5 years ago
GEtting this error in dependency register.
http://prntscr.com/mbkeot

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.