A problem using MEF + Directx

Apr 21, 2011 at 1:23 PM
Edited Apr 21, 2011 at 1:24 PM


Hi, I developed a plugin that uses Microsoft.DirectX.DirectSound and when I try to add the plugin to my catalog I get this exception:

Could not load file or assembly 'Microsoft.DirectX.DirectSound.dll' or one of STIsdependencies. A dynamic link library (DLL) initialization routine failed. (Exception fromHRESULT: 0x8007045A): "Microsoft.DirectX.DirectSound.dll
Parts = '(newSystem.ComponentModel.Composition.Primitives.ComposablePartCatalogDebuggerProxy(catalog)). Parts' Threw an exception of type 'System.Reflection.ReflectionTypeLoadException'

Please help me to solve this.

Apr 21, 2011 at 6:26 PM

Sorry MEF is amazing, the error was mine. I fixed it by adding in my app.config this lines:

<startup useLegacyV2RuntimeActivationPolicy="true">

    <supportedRuntime version="v4.0" />