Closed TiisangMguni closed 9 months ago
This is better for StackOverflow, as it has less to do with MediatR and more to do with dynamically loading assemblies.
I had the same issue with MediatR and solved it by using LoadFrom(path), instead of LoadFile(path)
Like this:
assemblies.Add(Assembly.LoadFrom("c:\SomePath\MyApp.dll"));`
builder.AddMediatR(assemblies)
Does anyone have a idea why this works:
But this doesn't work:
The reason why we need to load the DLL from disk is because we want to load "plugins" during runtime and cannot have a direct reference to the plugin DLLs