MEF:The exception message was: The composition remains unchanged

Apr 19, 2012 at 4:46 PM

In my project I have one infrastructure (class library) and two Silverlight modules.

Infrastructure class library has service class and I want access that class in my view model which is preset inside my first module.

I have added Export in service class in Infrastructure (class library) and added Import in View Model in first module.

I’m able to access service class methods in View Model in first module without any issue. When I navigate to second module I was facing following error.

An exception occurred while initializing module 'SecondModule'.

    - The exception message was: The composition remains unchanged. The changes were rejected because of the following error(s): The composition produced multiple composition errors, with 4 root causes. The root causes are provided below. Review the CompositionException.Errors property for more detailed information.

Please confirm, can I access infrastructure service class in first module without any issue (or) do I need to move infrastructure service class to first module itself.

May 3, 2012 at 7:04 PM

Hi there,

I hope you worked through this issue successfully. If not, part of the stack trace showing the MEF method being called when the exception is thrown, as well as the complete exception information would help to debug this. The text you've pasted indicates that there are four "root causes" to the composition issue - does that information help isolate the problem?

Thanks,
Nick