Component Dll - Still Unable To Load Mef
If you keep fighting MEF loading issues, consider:
Replace DirectoryCatalog with a custom catalog that uses Assembly.LoadFile instead of LoadFrom :
The word "still" in your search query suggests you have already attempted remediation. This usually implies one of two things: still unable to load mef component dll
You get BadImageFormatException in logs. The error mentions "attempt to load a program with an incorrect format."
If your DLL is (C++/CLI), it may require special handling. MEF often fails with mixed-mode assemblies loaded from certain contexts. If you keep fighting MEF loading issues, consider:
A developer on a Prism WPF application posted: "Still unable to load MEF component DLL for my module."
The error is often accompanied by an inner exception, such as FileNotFoundException , BadImageFormatException , or ReflectionTypeLoadException . MEF often fails with mixed-mode assemblies loaded from
MEF cannot read a file that is exclusively locked. This happens frequently when:
// Log but don't crash Console.WriteLine($"Failed: dll - ex.Message");