且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何编译网站以在64位Windows上使用32位Oracle Client

更新时间:2022-04-16 02:27:33

在IIS管理器中,创建一个应用程序池并将该应用程序池设置为以32位模式运行。然后,使用32位Oracle客户端分配您的网站以在该32位应用程序池中运行。

In IIS Manager, create an Application Pool and set that Application Pool to run in 32-bit mode. Then assign your website using 32-bit Oracle Client to run in that 32-bit Application Pool.

因为IIS为该应用程序池启动的辅助进程是32-位进程,当它尝试加载CLR时,它将加载32位CLR,因此将以32位模式加载程序集。即使您的程序集是为64位和32位模式编译的,也是如此。然后,以32位模式运行的程序集可以调用以32位模式运行的Oracle客户端。

Because the worker process that IIS starts for that Application Pool is a 32-bit process, when it tries to load the CLR it will load the 32-bit CLR and therefore will load your assembly in 32-bit mode. This is true even if your assembly was compiled for 64-bit and 32-bit modes. Your assembly running in 32-bit mode can then call the Oracle Client running in 32-bit mode.