Better handling of assembly version conflicts between packages' DLL dependencies
In the case where two plugin DLLs both reference the same assembly in different versions we can chose to either
- load both versions assuming that the two plugins do not need to exchange types defined in the referenced assembly.
- load only the newest assuming that the two versions are compatible.
Today we always do the latter (2.) in the assembly resolver. This is a problem because the plugin developer has no control over which dependencies are installed by other plugin packages and this can cause compatibility issues, breaking the plugin. The benefit of doing this is: Possibly using a newer and better version and performance during load / not having to JIT two assemblies with the same code.
We should instead do the former (1.). This will make each plugin package more independent of what other packages might contain. If the developer wants (2.) instead, because that is the correct assumption in a specific case, he can ensure that by aligning the versions of the reference.
In this case both plugin packages ship their own version of the referenced assembly (usually inside the "Dependencies" subfolder of the install dir). This is also the best way to do it when the plugins are completely independent (and the assumption in 1. holds). If the plugins are dependent, it would be better to have the version of the referenced assembly aligned by the developer before the plugin package is created. We can make a warning (maybe even an error) when trying to create a package that ships a referenced assembly if that assembly is also shipped by one of the package's dependencies in a different version.
Examples:
-
Dependent packages using same version of referenced assembly - no issue.
-
Dependent packages using different version of referenced assembly - might be an issue now. More likely to be an issue with proposed change. Proposed change should add a package create time warning or error in this case.
-
Independent packages using different version of referenced assembly - issue now. No issue with proposed change.