VirtoCommerce/vc-platform

Can't use Scrutor > 3.0.1 in a module

j-mok opened this issue · 2 comments

j-mok commented

The problem
We wanted to use Scrutor 4.2.1 in one of our modules but the module does not load because VC platform cannot load Scrutor:4.0.0.0:

 ---> System.IO.FileNotFoundException: Could not load file or assembly 'Scrutor, Version=4.0.0.0, Culture=neutral, PublicKeyToken=167d3117ac9a6821'. The system cannot find the file specified.

Root cause
VirtoCommerce.Platform.Web references Swashbuckle.AspNetCore.Filters 5.1.2 which transitively references Scrutor 3.0.1 (which in turn holds assembly Scrutor:3.0.0.0). That old Scrutor assembly ends up among platform's own dependencies in the root directory and prevents the newer Scrutor assembly from the module to be used.

Expected behavior
Provide a way to get around this limitation to Scrutor (specifically) or any 3rd party dependency (generally) version range when that dependency is also used by the VC platform itself. Or add an explicit NuGet reference to the latest Scrutor in VirtoCommerce.Platform.Web.

j-mok commented

OK, I guess this will do, although I think it is a general problem of platform's dependencies limiting those of the modules, especially when we speak of minor, tool/helper-like dependencies. Per-module assembly context isolation probably would help, but I understand that VC architecture did not take this approach. We will bump the platform then. Thanks!