I\'m making a console app on .Net Core platform and was wondering, how does one load assemblies (.dll files) and instantiate classes using C# dynamic features? It seems so m
Using .net core 1.1 / standard 1.6, I found that AssemblyLoader was not available, and
AssemblyLoadContext.Default.LoadFromAssemblyPath(assemblyPath)gave me a "Could not load file or assembly xxx" error.
Finally this solution below worked for me - purely by adding a step to get the AssemblyName object. Hope it helps anyone who gets stuck:
var assemblyName = AssemblyLoadContext.GetAssemblyName(assemblyPath); var assembly = Assembly.Load(assemblyName);