2
votes

After ading a new module to a prism project I keep getting the error from the title. When creating a module I did the following:

  1. Added a new WPF User Control Library
  2. Added a class that inherits from IModule like this:

    [ModuleExport(typeof(ClassA))] public class ClassA: IModule { public void Initialize() { } }

  3. Added the necessary references: Microsoft.Practices.Prism, and MefExtenstions

  4. Added the proper module declaration in app.config

Am I missing any steps?

I have other modules that look almost the same as the new one (appart from the fact that they have views and viewmodels) and they are working perfectly fine.

1
Failed to load type for module XXX. If this error occurred when using MEF in a Silverlight application, please ensure that the CopyLocal property of the reference to the MefExtensions assembly is set to true in the main application/shell and false in all other assemblies. Error was: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information..mobearette
also need to view the codeC Sharper
I added the Bootstraper code since this is the only part of the code that gets called before the exception occuresmobearette
I don't think that the problem is in your Bootstrapper but in you app.config's module catalog. That error usually means that Prism could not find the type for the module that you specified in the configuration file. Can you post it or at least add the line defining this particular module in the config file?Damian Cherubini
This is how the module definition in the config file looks like:<module assemblyFile="Company.Project.APIModule.dll" moduleType="Company.Project.APIModule.APIModule, Company.Project.APIModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" moduleName="APIModule" startupLoaded="true" />mobearette

1 Answers

0
votes

Try changing the Build path for your lib projects it should be same bin folder as for the project with bootstrapper.