Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6879001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:47:33+00:00 2026-05-27T04:47:33+00:00

we are currently using MEF (Managed Extensibility Framework, http://mef.codeplex.com/ ) and it throws out

  • 0

we are currently using MEF (Managed Extensibility Framework, http://mef.codeplex.com/ ) and it throws out exceptions, with limited information to proceed on.

is there a way to debug MEF exceptions?

My exception is like this:

System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)

   at System.Reflection.RuntimeModule.GetTypes()

   at System.Reflection.Assembly.GetTypes()

   at System.ComponentModel.Composition.Hosting.AssemblyCatalog.get_InnerCatalog()

   at System.ComponentModel.Composition.Hosting.AssemblyCatalog.GetExports(ImportDefinition definition)

   at System.ComponentModel.Composition.Hosting.AggregateCatalog.GetExports(ImportDefinition definition)

   at System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)

   at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)

   at System.ComponentModel.Composition.Hosting.AggregateExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)

   at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)

   at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExports(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)

   at System.ComponentModel.Composition.Hosting.CompositionContainer.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)

   at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)

   at System.ComponentModel.Composition.Hosting.ExportProvider.GetExports(ImportDefinition definition, AtomicComposition atomicComposition)

   at System.ComponentModel.Composition.Hosting.ImportEngine.TryGetExports(ExportProvider provider, ComposablePart part, ImportDefinition definition, AtomicComposition atomicComposition)

   at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImportSubset(PartManager partManager, IEnumerable`1 imports, AtomicComposition atomicComposition)

   at System.ComponentModel.Composition.Hosting.ImportEngine.TryPreviewImportsStateMachine(PartManager partManager, ComposablePart part, AtomicComposition atomicComposition)

   at System.ComponentModel.Composition.Hosting.ImportEngine.PreviewImports(ComposablePart part, AtomicComposition atomicComposition)

   at System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.Compose(CompositionBatch batch)

   at System.ComponentModel.Composition.Hosting.CompositionContainer.Compose(CompositionBatch batch)

   at System.ComponentModel.Composition.AttributedModelServices.ComposeParts(CompositionContainer container, Object[] attributedParts)

   at MyApp.Extension..ctor(Assembly assembly) in W:\MyApp\Source\\Extensions\Extension.cs:line 45

The Code is simple:

var aggregateCatalog = new AggregateCatalog();
_assembly = assembly;
var assemblyCatalog = new AssemblyCatalog(assembly);
aggregateCatalog.Catalogs.Add(new AssemblyCatalog(System.Reflection.Assembly.GetExecutingAssembly()));
aggregateCatalog.Catalogs.Add(assemblyCatalog);
_compositionContainer = new CompositionContainer(aggregateCatalog);
_compositionContainer.ComposeParts(this);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:47:34+00:00Added an answer on May 27, 2026 at 4:47 am

    I feel your pain. When I’m stuck, I typically dump the MEF composition information to get more information on the cause of the composition failure. For instructions on how to do this, see Diagnosing Composition Problems in the MEF Programming Guide or the Debugging MEF topic on MSDN.

    In .NET 4.5 (or the current MEF 2 preview 4 release available on codeplex) there is a simpler option: you can improve the usefulness of the error message by disabling silent rejection in the CompositionOptions which you pass to the container constructor.

    edit: ah, you’re getting a ReflectionTypeLoadException. That’s another matter: it means that the types in some assembly cannot be successfully loaded, typically because they reference other types that cannot be found. In your code example, you should be able to reproduce the problem by invoking assembly.GetTypes(), without involving MEF.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm coding an extension in C# using the Managed Extensibility Framework (MEF). How can
Has anyone worked much with Microsoft's Managed Extensibility Framework (MEF)? Kinda sounds like it's
Im currently using vs2008 with asp.net mvc framework for web development. Im missing a
I'm currently using MEF for a project to import plugins, as the plugins are
Currently using: @^(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&%\$#_]*)?$ How can i make http:// not compulsory but if it does
Currently using ColdFusion 8 enterprise on 32 bit linux box to send out our
I'm currently successfully using MEF to load-on-demand Xaps in my Silverlight 4 application. I
We are currently looking at either using CAB or MEF for our next application.
I'm very interested in using 4.0 framework and also the Entity Framework 4.0. Currently
Currently, I'm developing an extension to Visual Studio 2010 using MEF and I need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.