【发布时间】:2012-03-12 14:37:00
【问题描述】:
我正在尝试使用 MEF 编写一个可扩展的 Metro 应用程序。我让它与本地扩展一起工作(在当前程序集中)。现在我想加载一个外部 dll。 DirectoryCatalog 似乎不存在于 .net 4.5 中。所以我尝试使用ApplicationCatalog,但在调用SatisfyImportsOnce时出现以下错误:Assembly.LoadFrom is not supported in AppX.。
这是我的代码:
var catalog = new AssemblyCatalog(GetType().GetTypeInfo().Assembly);
ApplicationCatalog catApp = new ApplicationCatalog();
AggregateCatalog cat = new AggregateCatalog(catalog, catApp);
_compositionService = cat.CreateCompositionService();
_compositionService.SatisfyImportsOnce(this);
有什么建议吗?
我已将 dll 放在 Appx 目录中,并以管理员身份运行 VS11 Beta。
【问题讨论】:
标签: c# mef microsoft-metro windows-runtime .net-4.5