I have a solution and multiple .net core projects.
- Project (solution)
- WebApi
- Business
- Data
WebApi
project references Business
, but does not reference Data
project. So I want to get all types in solution that implements IMyInterface
. All projects has classes that implements IMyInterface
. I want to find all of them.
I am calling following code in WebApi project:
var m = AppDomain.CurrentDomain.GetAssemblies()
.SelectMany(name => name.GetTypes())
.Where(type => typeof(IMyInterface).IsAssignableFrom(type))
.ToList();
But not types found.
How can I find?