none
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:

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

    Is it possible to use something like this:

    <modules>
      <module assemblyFile="$(AppDir)\Plugins/MyPlugin.dll" moduleType="Plugin.Module"
              moduleName="MyPlugin" startupLoaded="true" />
    </modules>
    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

Answers

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.

    https://github.com/PrismLibrary/Prism/issues

    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,

    Wendy


    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 MSDNFSF@microsoft.com.

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

    my application is WPF: https://github.com/Dirkster99/Edi

    I entered a new issue here: https://github.com/PrismLibrary/Prism/issues/1151

    Thanks for your feedback Dirk

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