动态加载的程序集基于当前进程是否是X32或x64 [英] Dynamically loading an assembly based on whether current process is x32 or x64

查看:176
本文介绍了动态加载的程序集基于当前进程是否是X32或x64的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些code的动态加载的程序集取决于Environment.Is64BitProcess属性,然后根据用户需要的结果。

I have some code which dynamically loads an assembly depending on the result of the Environment.Is64BitProcess property which is then used as required.

这是不是MEF可以自动做到人无我有使用环境和放大器;大会班?

Is this something MEF could do automatically without me having to use the Environment & Assembly classes?

我会写一些扩展,MEF来实现这一目标?

Would I have to write some kind of extension to MEF to achieve this?

Framework版本:.NET 4.0中

Framework version: .Net 4.0

推荐答案

将32位组件在一个文件夹中,64位组件在另一个。然后加载使用MEF基于Environment.Is64BitProcess适当的文件夹。

Place 32 bit assemblies in one folder, and 64 bit assemblies in another. Then load the proper folder using MEF based on Environment.Is64BitProcess.

这篇关于动态加载的程序集基于当前进程是否是X32或x64的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆