我与 MEF 合作,我正在寻找如何通过 MEF 找到插件的另一种方式更改插件位置的 url,我想更改这一行
Assembly.LoadFrom(@"C:\julia\project\project.Plugin.Nav\bin\Debug\NavPlugin.dll")));
我想删除这个 url,因为我需要在另一台机器上部署我的应用程序
这是我的功能:
public void AssembleCalculatorComponents()
{
try
{
//var catalog = new AssemblyCatalog(Assembly.GetExecutingAssembly());
//var container = new CompositionContainer(catalog);
//container.ComposeParts(this);
var catalog = new AggregateCatalog();
catalog.Catalogs.Add(new AssemblyCatalog(Assembly.LoadFrom(@"C:\yosra\project\project.Plugin.Nav\bin\Debug\NavPlugin.dll")));
var container = new CompositionContainer(catalog);
container.ComposeParts(this);
}
catch (Exception ex)
{
throw ex;
}
}
你能帮我么?
谢谢