Avoid error message: "Failed to load type for module...The composition remains unchanged"
-
Saturday, July 23, 2011 2:28 AM
Hello,
Ever tried to work through an example, did every step consiously and yet... an error occurs. For example this one:
Failed to load type for module MyModuleName. Error was: the composition remains unchanged. The changes were rejected because of the following error(s): The composition producesd multiple composition errors, with # root causes. The root causes are provided below. Review the CompositionException.Errors propery for more information.
Then follows a list of errors, and none of them points out clearly what went wrong. And the solution is very simple, but crucial to sort out right.
It is this: in the module you want to have composed, you have set references to "Microsoft.Practices.Prism.MefExtensions.dll" and to "Microsoft.Practices.Prism.dll". When you reference these, they are automatically set to "Copy Local=True" in their properties. These two references have to be changed into "Copy Local=False".
Recompile and voila: your application (MEF) composes like you hoped it would!
Please mark as "answer" if you found this useful.
All Replies
-
Tuesday, October 25, 2011 3:29 PM
hi,
My code is working fine on my machine but facing same issue in output published by teambuild. It is observed that size of xap files is different in both cases(code published on my machine and code published by teambuild).
Regards
GA.
-
Thursday, November 10, 2011 7:47 AM
good solution, your post is just helpful.
thank you very much
FENG
-
Wednesday, February 15, 2012 9:07 AM
Thanks a lot!!! I didn't knew what went wrong....I was working on this issue more than an hour.....

