Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
I found the following code snippet is functionality equivalent to the usage of directory catalogs:
// Find and load all the DLLs in the folder var assemblies = Directory.GetFiles(directory, "*.dll") .Select(path => AssemblyLoadContext.Default.LoadFromAssemblyPath(path)) .Where(x => x != null); // Add the loaded assemblies to the container var configuration = new ContainerConfiguration() .WithAssemblies(assemblies) .WithAssembly(this.GetType().GetTypeInfo().Assembly); return configuration.CreateContainer();
I think this approach works well, though it would be nice to have an extension method on the ConfigurationContainer that does this. So instead of WithAssemblies, use WithAssembliesFromDirectory() which loads the assemblies and adds them to them to the configuration.
I suspect that this issue is caused by the application not having permissions to the directory outside of its bin. Doing a