1

我有一个 Silverlight 应用程序,它使用 MEF 将 UserControl 插件加载到主 shell 中。每个插件都有一个元数据,其中描述了插件的名称、版本、图标和类似的内容,我使用 [ImportMany] 属性将它们全部导入主 shell。当我单击导航栏上的一个插件时,视图占位符会导航到相应的插件。我觉得很奇怪它应该在导航上抛出这样的异常。如果我删除插件中的 [Export] 属性,一切正常。

调用者抛出异常。这是回溯:

in System.Windows.Navigation.PageResourceContentLoader.EndLoad(IAsyncResult asyncResult)
in System.Windows.Navigation.NavigationService.ContentLoader_BeginLoad_Callback(IAsyncResult result)
in System.Windows.Navigation.PageResourceContentLoader.BeginLoad_OnUIThread(AsyncCallback userCallback, PageResourceContentLoaderAsyncResult result)
in System.Windows.Navigation.PageResourceContentLoader.<>c__DisplayClass4.<BeginLoad>b__0(Object args)

我进行了很多搜索,许多人说这是与缓存和重新父级有关的事情(一个经典问题),尽管我仍然无法弄清楚某些文章中描述的案例与我的不一样。

有人知道发生了什么吗?

4

0 回答 0