Loading Modules in MEF via app.config RRS feed

  • Question

  • I want to use PRISM MEF to load a module but the loading fails when I start the application from a different folder than the application's folder. I am using the following app.config entry which works otherwise OK:

      <module assemblyFile="Plugins/MyPlugin.dll" moduleType="Plugin.Module"
              moduleName="MyPlugin" startupLoaded="true" />

    Is it possible to use something like this:

      <module assemblyFile="$(AppDir)\Plugins/MyPlugin.dll" moduleType="Plugin.Module"
              moduleName="MyPlugin" startupLoaded="true" />
    to always force the searchpath below the application's path?

    • Edited by Dirkster999 Wednesday, August 30, 2017 8:25 PM
    Wednesday, August 30, 2017 8:24 PM


All replies

  • Hi Dirkster999,

    Thank you for posting here.

    For your question, what is the type of your project? UWP or WPF?

    You could post a new thread in GitHub. It is suitable for Prism of UWP and WPF.

    The CLR Forum discuss and ask questions about .NET Framework Base Classes (BCL) such as Collections, I/O, Regigistry, Globalization, Reflection. Also discuss all the other Microsoft libraries that are built on or extend the .NET Framework, including Managed Extensibility Framework (MEF), Charting Controls, CardSpace, Windows Identity Foundation (WIF), Point of Sale (POS), Transactions. 

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Friday, September 1, 2017 6:29 AM
  • Hi Wendy,

    my application is WPF:

    I entered a new issue here:

    Thanks for your feedback Dirk

    • Marked as answer by Dirkster999 Friday, September 1, 2017 10:10 AM
    Friday, September 1, 2017 10:10 AM