【发布时间】:2013-06-24 15:12:52
【问题描述】:
问题:
我有两个项目。第一个命名为 Studio,第二个命名为 Worker,这是一个类库。 Worker 项目是指一些第三方程序集,如 Ecng.Common、Ecng.Data 等。
当我尝试通过 MEF 在 Studio 中加载 Worker 时,MEF 抛出异常:
找不到文件或程序集 Ecng.Transactions
但是,Worker 中没有针对 Ecng.Transactions 的项目引用。工人在没有它的情况下工作。
我需要做什么来解决这个问题?
编辑 1:
var catalog = new AggregateCatalog();
foreach (var nameAndPath in robotsDirectory)
{
catalog.Catalogs.Add(new DirectoryCatalog(nameAndPath.Value));
}
var container = new CompositionContainer(catalog);
container.ComposeParts(this); // Here i have Exception
【问题讨论】:
-
你需要添加一些代码,所以这里的人可能会帮助你