Dependencies of dinamically loaded .dll are not found [Answered]
Hi everyone,
I've an ASP.NET Core 6 web app where I have a main project "A" that, if certain conditions are meet, load dinamically an assembly B.dll. Now, let's say B depends upon some nuget package C (has a static reference to it). When, after B assembly has been loaded dinamically and during its code execution a class belonging to C is encountered, the program crashes since C is not found.
I've noticed that, if I add to project A a static reference to C, everything works fine.
Is there a way to fix this behavior without me having to add to project A static references to ALL dependencies of ALL the assemblies I want to load dinamically? Thanks
I've an ASP.NET Core 6 web app where I have a main project "A" that, if certain conditions are meet, load dinamically an assembly B.dll. Now, let's say B depends upon some nuget package C (has a static reference to it). When, after B assembly has been loaded dinamically and during its code execution a class belonging to C is encountered, the program crashes since C is not found.
I've noticed that, if I add to project A a static reference to C, everything works fine.
Is there a way to fix this behavior without me having to add to project A static references to ALL dependencies of ALL the assemblies I want to load dinamically? Thanks