Incompatible dll references are silently ignored
PluginSearcher ignores incompatible plugin dependencies which causes tap package create
to exclude critical dlls from builds silently.
Scenario:
- Project 'A' uses Microsoft.AspNetCore.Mvc.Core v2.2.5.0 -- which depends on --> Microsoft.Extensions.DependencyModel v2.1.0.0
- Project 'b' uses netcoreapp2.1 -- which depends on --> Microsoft.Extensions.DependencyModel v1.0.1.0
Depending on the build, either Microsoft.Extensions.DependencyModel v1.0.1.0 OR v2.1.0.0 will exist in the output folder. And actually during the build there is no warning about this.
Then during tap package create
, the PluginSearcher looks at Microsoft.AspNetCore.Mvc.Core and sees its dependency on Microsoft.Extensions.DependencyModel v2.1.0.0, but since only v1.0.1.0 is available it silently ignores the issue and pretends like the DLL was not a dependency after all. This in turn means that the DLL does not get included in the TapPackage and when deployed the software breaks.
I suggest the following:
- We emit a warning during startup if we have to ignore a DLL for whatever reason
- We should also keep track of the ignored dlls.
- During package create, if we detect that a dll has ignored references, we should give up on creating the package, since not all dependencies could be resolved.