I know how to get all types that implement an interface such as using this code.
However I have not figured out why I can't make this work in my Asp.Net MVC ApiController. I have two projects (apologies for the naming convention. I created a solution from scratch just to make sure that my existing one was not the cause of the error):
.sln
-WebAPI
-ClassLibrary1
-Interface1
-Class1 : Interface1
WebApi has a project reference to ClassLibrary1.
Calling my ApiController it looks at the dlls in the bin directory. It is able to get ClassLibrary1.dll but when it tries to look at which type is assignable from Interface1 it does not find anything.
Code is just a .net mvc project and class library and hosted here

The problem is that you have the assembly
ClassLibrary1loaded twice and thereforeClassLibrary1.Interface1from the reference is not the same interface asClassLibrary1.Interface1from the loaded assembly.Move
Interface1to its own shared library and reference this shared library in bothClassLibrary1andWebAPIto solve your problem.About
Assembly.LoadFile, this is fine if you're planning to make a plugin like system. This is not needed if you are referencing the library because then you can just enumerate the types from the already loaded assembly.In that case you can use:
as suggested by Bhushan Firake.