views:

18

answers:

1

When my Deployment Catalog contains System.Windows.Controls.Layout.Toolkit.dll MEF 'breaks'... All I'm doing is adding a reference to this file in my project and the following diagnostics code writes nothing to the VS Output Window:

this.CompositionContainer.ExportsChanged += (s, args) =>
{
    var o = args.AddedExports;
    o.ToList().ForEach(export =>
        System.Diagnostics.Debug
            .WriteLine("MEF export: " + export.ToString()));
};

...when the reference is removed the ExportsChanged event fires. Is this problem my "special" problem or can someone else on Earth reproduce this problem?

+1  A: 

Make sure you are subscribing to the DownloadCompleted event of the DeploymentCatalog. In your event handler, check the Error property of the EventArgs, and it will probably tell you what the problem is.

Daniel Plaisted
I'm checking this now...
rasx
Message = "Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information."
rasx
[outer ex:] Message = "The package downloaded successfully but an error occurred while reading the contents of the package. See the inner exception for more details."
rasx
"Could not load file or assembly 'System.Windows.Controls.Toolkit, Version=4.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The requested assembly version conflicts with what is already bound in the app domain or specified in the manifest. (Exception from HRESULT: 0x80131053)"
rasx
This article details: http://devlicio.us/blogs/derik_whittaker/archive/2010/01/31/mef-and-decrypting-loaderexceptions.aspx
rasx