Hi Andrei,
First let us explain how we have made our plugin infrastructure.
We have some libraries similar to the ones in nopCommerce i.e Core, Services, Framework that are referenced by all our plugins but we don't want to distribute them with each plugin.
That's why we have a Core plugin that contains all our libraries.
We have named our plugins in a way that when sorted alphabetically the Core plugin will be before the other plugins i.e:
SevenSpikes.Core
SevenSpikes.Nop.Plugins.xxx
This way we are sure the Core will be loaded first and the referenced assemblies (Core, Services, Framework) will be loaded.
Then when any other of our plugins is loaded it will find the referenced assemblies already loaded in the App Domain.
Now on startup in the PluginManager when the plugin assemblies are loaded the logic of loading the plugins is random.
To illustrate it with code:
foreach (var descriptionFile in pluginFolder.GetFiles("Description.txt", SearchOption.AllDirectories))
{ Logic of Loading a plugin assembly and all referenced assemblies here!!! }
This way there is no specific order in which the plugins are loaded.
Usually the order is based on the name of the folder in which the Description.txt file resides but this is not always the case.
Recently one of our clients had a hosting that doesn't order the folders in the Plugins folder alphabetically.
So we can't really rely on some assumptions how the operating system will sort the folders.
Could you please change the way the plugins are loaded.
Best will be to reuse the DisplayOrder in the Description.txt file.
This way we will have a predictable way in which the plugins will be loaded.
If you want we can contribute the code changes.
Many thanks.