var catalog = new AggregateCatalog();
catalog.Catalogs.Add(new DirectoryCatalog("."));
var container = new CompositionContainer(catalog);
var catalog = new AggregateCatalog();
catalog.Catalogs.Add(new AssemblyCatalog(Assembly.GetExecutingAssembly()));
catalog.Catalogs.Add(new DirectoryCatalog("."));
var container = new CompositionContainer(catalog);
public void AssembleCalculatorComponents()
{ string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Plugins");
Console.WriteLine(path);
//Check the directory exists
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
Console.WriteLine(path);
string assemblyName = Assembly.GetEntryAssembly().FullName;
Console.WriteLine(assemblyName);
//Create an assembly catalog of the assemblies with exports
var catalog = new AggregateCatalog(
new AssemblyCatalog(Assembly.GetExecutingAssembly().Location),
new AssemblyCatalog(Assembly.Load(assemblyName)),
new DirectoryCatalog(path, "*.dll")); //Create a composition container
var container = new CompositionContainer(catalog);
container.ComposeParts(this);

MEF load plugin from directory的更多相关文章

  1. [-] Failed to load plugin from /usr/share/metasploit-framework/plugins/db_autopwn: No classes were loaded from /usr/share/metasploit-framework/plugins/db_autopwn in the Msf::Plugin namespace.

    问题详情 然后,执行,出现如下问题,则说明大家的这个文件,下载不是完整的或者你上传不完整. msf > load db_autopwn [-] Failed to load plugin fro ...

  2. Dynamics 365 CRM On premise Unable to Load plug-in assembly

    背景介绍: 本地部署Microsoft Dynamics CRM 9.0正常可用,后打补丁到9.0.16.7,打开系统quote报 “ Unable to Load plug-in assembly” ...

  3. jquery的延迟加载插件Lazy Load Plugin for jQuery

    下载:https://github.com/tuupola/jquery_lazyload 使用:http://www.appelsiini.net/projects/lazyload 翻译:http ...

  4. Lazy Load Plugin for jQuery延迟加载测试成功

    一直需要的功能,网页图片太多时对于降低网络流量超有用. 最新的V1.9.3版本其实已不用修改就可以起作用了. 不用网上说的要自己修改代码.

  5. linux下C++ 插件(plugin)实现技术

    应用程序中使用插件技术,有利于日后的版本更新.维护(比如打补丁)和功能扩展,是一种很实用的技术.其最大的特点是更新插件时无需重新编译主程序,对于一个设计良好的应用系统而言,甚至可以做到业务功能的在线升 ...

  6. The ultimate jQuery Plugin List(终极jQuery插件列表)

    下面的文章可能出自一位奥地利的作者,  列出很多jQuery的插件.类似的网站:http://jquerylist.com/原文地址: http://www.kollermedia.at/archiv ...

  7. LoadRunner 2020 社区版本负载机(Load generator)Linux 安装教程

    1.HP官方注册 下载 LoadRunner_2020_Edition_Standalone_Applications_Micro_Focus_LoadRunner_2020_Community_Ed ...

  8. 【转】 svn 错误 以及 中文翻译

    直接Ctrl+F 搜索你要找的错 # # Simplified Chinese translation for subversion package # This file is distribute ...

  9. Spark(3) - External Data Source

    Introduction Spark provides a unified runtime for big data. HDFS, which is Hadoop's filesystem, is t ...

随机推荐

  1. gz

    不准备的话,是真的会滚粗的. leetcode  还是重新做起来叭. 那么就开始咯 8.22 leetcode 144 Binary Tree Preorder Traversal 二叉树的前序遍历 ...

  2. Positive-definite matrix

    In linear algebra, a symmetric n × n real matrix M is said to be positive definite if zTMz is positi ...

  3. [HB2014 Week5] Allot 人员分配

    这两天决心专门搞好网络流了 - - 题解在什么瞎胡搞跟我说要连n+2和n+1容量为无穷的边…我看了下std才做的… 坑死人的地方就是,需要求多次网络流,每次别忘了把流给清空了…这次是用链表所以专门写了 ...

  4. Python学习路程day10

    Twsited异步网络框架 Twisted是一个事件驱动的网络框架,其中包含了诸多功能,例如:网络协议.线程.数据库管理.网络操作.电子邮件等. 事件驱动 简而言之,事件驱动分为二个部分:第一,注册事 ...

  5. 简单poi读取excel

    1.添加依赖jar包 maven配置: <!-- poi being --> <dependency> <groupId>org.apache.poi</gr ...

  6. RedHat5配置网卡

    RedHat5配置网卡过程: 1.vi /etc/sysconfig/network-scripts/ifcfg-eth0 2.将hdcp修改成static 3.最后添加 IPADDR=192.168 ...

  7. cocos2dx常见的46中+22中动作详解

    cocos2dx常见的46中+22中动作详解 分类: iOS2013-10-16 00:44 1429人阅读 评论(0) 收藏 举报 bool HelloWorld::init(){    ///// ...

  8. 线程和NSThread 、 NSOperation

    1 使用NSThread实现打地鼠 1.1 问题 NSThread是ios提供的轻量级的多线程解决方案,但是需要自己管理线程的生命周期.线程同步等.本案例使用NSThread实现一个打地鼠的小游戏,在 ...

  9. PAT (Basic Level) Practise:1012. 数字分类

    [题目链接] 给定一系列正整数,请按要求对数字进行分类,并输出以下5个数字: A1 = 能被5整除的数字中所有偶数的和: A2 = 将被5除后余1的数字按给出顺序进行交错求和,即计算n1-n2+n3- ...

  10. asp.net 把图片压缩成zip之后再进行下载

    //这是导出的js方法 function fundaochu() { var data = "keyword=GetImageListdaochu&type=daochu&m ...