c# - Autofac won't resolve class from external dll -
i'm trying create application utilizes autofac , loads external dlls. following code works, if dll located in same folder , program ran same folder:
builder.registerassemblytypes(assemblies.toarray()). where(t => typeof(iimageconverter).isassignablefrom(t)). instanceperlifetimescope().asimplementedinterfaces();
now if try run program different location set working directory directory dll located, autofac finds , loads dll, doesn't resolve run it:
using (var scope = _container.beginlifetimescope()) { var processors = scope.resolve<ienumerable<iimageconverter>>(); foreach (var process in processors) process.process(); }
those autofac lines have. interface defined in shared library , each module implements default. missing?
thanks in advance!
it depends on values assigned assemblies
. autofac not load dlls, scans loaded assemblies.
read dynamicic module loading determine how load external dlls.
Comments
Post a Comment