如何配置 MEF(托管扩展性框架)以仅加载签名的程序集
我有一个使用 MEF 动态加载程序集的应用程序。但是,目前,它正在加载我的程序集,无论它们是否已签名。我想防止其他人放入他们自己的程序集并让我的应用程序加载并运行它们。我希望 MEF 仅加载已由我签名的程序集。
这可以做到吗?如果是这样,怎么办?
谢谢
I have an application that uses MEF to dynamically load assemblies. However, currently, it is loading my assemblies whether they are signed or not. I want to prevent others from dropping in their own assemblies and having my application load them and run them. I'd like MEF to only load assemblies that have been signed by me.
Can this be done? If so, how?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
以下博客文章准确展示了如何执行此操作:如何控制谁可以为您的 MEF 应用程序编写扩展
Here's a blog post that shows exactly how to do this: How To Control Who Can Write Extensions For Your MEF Application
是的。实现一个过滤目录来检查程序集的公钥是否是唯一的您指定的。
)
Yes. Implement a filtering catalog that checks if the public key of the assembly is the one that you specify.
)