开发者

Running IIS with WOW64 and loading 64-bit DLL

开发者 https://www.devze.com 2023-04-12 15:27 出处:网络
A client is 开发者_如何学Pythonrunning IIS with WOW64 enabled and is complaining that she cannot load our 64-bit DLL.

A client is 开发者_如何学Pythonrunning IIS with WOW64 enabled and is complaining that she cannot load our 64-bit DLL.

Is there any way to do this?

Also, does running IIS with WOW64 imply that all .NET code is running under a 32-bit .NET runtime?


If IIS is configured to start a 32-bit W3WP.EXE, which will run under WoW64, then yes, anything that happens within that worker process will happen in 32-bit mode and thus you will use a 32-bit .NET runtime.

A corollory to this is that you cannot load a 64-bit DLL as these are incompatible with 32-bit processes. Either you need to supply a 32-bit version of your DLL or you need your client to disable 32-bit W3WP.exe.

If your DLL is a COM DLL then you have a further option: register it in COM+ and have it run out-of-process from the IIS app. This then means your 32-bit code can call into 64-bit code via COM calling mechanisms (which Windows will take care for you under the hood).

The setting in IIS to change this is under the Application Pool properties in IIS and is "Enable 32-bit applications". Setting to true forces 32-bit worker processes; setting to false enables 64-bit worker processes.

0

精彩评论

暂无评论...
验证码 换一张
取 消