MEF 默默地停止在部署目录中查找导出?

发布于 2024-09-26 12:52:52 字数 470 浏览 2 评论 0原文

当我的部署目录包含 System.Windows.Controls.Layout.Toolkit.dll MEF“中断”时...我所做的就是在我的项目中添加对此文件的引用以及以下诊断代码向 VS 输出窗口写入无内容

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

...当引用被删除时,ExportsChanged 事件将触发。这个问题是我的“特殊”问题还是地球上的其他人可以重现这个问题?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

兔小萌 2024-10-03 12:52:52

确保您订阅 DeploymentCatalog 的DownloadCompleted 事件。在您的事件处理程序中,检查 EventArgs 的 Error 属性,它可能会告诉您问题是什么。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文