c# - Best way to load required assemblies from another path -
i have control engine processes jobs. each job configuration specifies assembly , class needs find jobs run interface in. assembly local or on server.
eg have following implement run interface
\server1\assembly1.class1 \server2\folder1\assembly2.class2 \server3\folder2\folder3\assembly3.class3
i want able configure 3 jobs, each 1 referencing relevant path , assembly name should run. control engine uses reflection load specified assembly above , runs run() method.
however difficulty have if assembly loading has dependencies, not loaded. eg if assembly1 depends on entity framework , control engine doesn't have dependency, fail. entity framework of course present in same folder \server1\assembly1.class1 example class1 depends on , builds location, control engine knows load class1, not ef.
i need way specify each job, dependent assemblies required load , best way load them same location run() interface assembly class.
i have looked @ appdomain.assemblyresolve , thought using custom attribute , reflection feel haven't cottoned on best design feels hacky.
any suggestions?
Comments
Post a Comment