Windows Azure 上的 32 位旧 COM DLL [英] 32-bit legacy COM DLLs on Windows Azure

查看:21
本文介绍了Windows Azure 上的 32 位旧 COM DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的 Web 应用程序中使用了大约 15-20 个旧的 32 位 C++ COM DLL,其中一些 32 位 DLL 具有 3rd 方依赖项,这些依赖项进一步是 DLL 的 COM 或本机.

I use around 15-20 legacy 32-bit C++ COM DLLs in my web app, some of these 32-bit DLLs have 3rd party dependencies which are further DLL's COM or native.

我正在考虑迁移到 Windows Azure,我知道它是一个 64 位平台.谁能告诉我我的 32 位 DLL 是否可以工作?(我知道现在可以 regsvr32 它们).

I am considering moving to Windows Azure which I understand is a 64-bit platform. Can anyone advise whether my 32-bit DLLs will work? (I know that it is now possible to regsvr32 them).

经过一两周的工作,我可以将我的 DLL 重新编译为 64 位,但是这对于 3rd 方依赖项是不可能的,因为我没有源.

With a week or two’s work I could recompile my DLLs to 64-bit however this is not possible for the 3rd party dependencies as I don’t have the source.

我知道 Windows Azure 使用 64 位,所以我想知道迁移我的应用程序的最佳方法是什么?

I understand that Windows Azure uses 64-bit so I am wondering what would be the best approach here to migrate my app?

即我应该将 32 位 DLL 移过来并依赖 WoW64 – 这甚至可以工作吗?我不介意小的性能损失.

i.e. should I move the 32-bit DLLs over and rely on WoW64 – will this even work? I don’t mind a small performance hit.

或者重新编译我的 64 位应用程序并以某种方式使用 32 位 DLL 会更好吗?

Or would be it better to recompile my 64-bit apps and somehow use the 32-bit DLLs?

推荐答案

答案是肯定的.Windows Azure 就像一个普通的 Windows Server 2008 x64,它有 32 位子系统.这里唯一的限制是 Web 角色和辅助角色托管进程是 64 位的.

The answer is yes. Windows Azure is just like a normal Windows Server 2008 x64, and it has 32-bit subsystem. The only limitation here is that the web role and worker role hosting process is 64 bit.

考虑到这一点,您将不得不在 64 位主机进程和 32 位 DLL 之间进行某种互操作.当然,在这种情况下,inproc COM 对象将不起作用.在不了解细节的情况下,很难在这里给出更具体的建议:

With this in mind, you will have to do some sort of interop between 64-bit host process and 32-bit DLLs. Of course, inproc COM objects will not work in this case. It is hard to give more specific advise here without knowing details:

  1. 什么类型的 COM 接口(自动化兼容与否)?
  2. 他们支持什么样的封送处理(仅进程内或进程外)
  3. 如果封送处理跨进程工作,您是否可以控制如何注册对象(进程内或进程外).
  4. 为您的对象创建托管包装器有多容易(例如由 32 位进程托管并能够使用 WCF 或 COM 自动化与 64 位主机通信的自定义 C++/CLI 互操作程序集)

我不知道它是否可行,但要考虑的另一个选择是尝试将您的应用程序池限制为作为 32 位进程运行.您需要以完全信任的方式在 IIS 模式下运行,并将其作为您的角色启动任务运行:
appcmd apppool set/apppool.name:/enable32BitAppOnWin64:true
您必须确定将使用您的应用程序的应用程序池的名称.再说一次,我不确定这是否有效,但我想值得一试,因为如果它有效,它对您来说将是最简单的选择.

I don't know if it would work, but another option to consider is try to coerse your application pool to run as 32 bit process. You will need to run in IIS mode with full trust and run this as your role startup task:
appcmd apppool set /apppool.name: /enable32BitAppOnWin64:true
You will have to determine name of application pool your app will be used. And again, I'm not sure that would work at all, but I guess it worth a try, because if it works it would be the easiest option for you.

这篇关于Windows Azure 上的 32 位旧 COM DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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