I am trying to write some logic to reflect some existing logic in the original .NET application. In my method, OnModelCreating()I want to load all current types into loaded assemblies in order to find those that need to be registered for the entity type configuration in the model.
This was done in .NET with AppDomain.CurrentDomain.GetAssemblies().Select(a => a.GetTypes()), but AppDomainno longer exists in .NET Core.
Is there a new way to do this?
I have seen some examples of online use DependencyContext.Default.RuntimeLibraries, however DependencyContext.Defaultit does not seem to exist anymore.
Edit:
Now I have found that the project is being added Microsoft.Extensions.DependencyModelto the project .netcoreapp1.1. However, I actually write a solution with several projects, and somehow I need to load this type in my project .netstandard1.4, where is my implementation of the DbContext implementation and the entity type
source
share