Inconsistency in use of WOW6432node registry key
I have a .NET web application that needs to read some configuration data from the Registry. The Registry key it reads from is similar to this:
HKLM\Software\VendorX\AppConfig
It installs and runs just fine on most W2K8 and W2K8 R2 servers. However, every once and a while, when it gets installed on a W2K8 server, it expects to read its configuration from
HKLM\Software\WOW6432node\VendorX\AppConfig
I am trying to figure out under what circumstances would cause the application to expect to find the registry keys under WOW6432node. I cannot find any commonality between the different servers. I have read KB 896459. This seems like it the
behavior would be consistent, but it is not.
If anyone has any thoughts, I would appreciate hearing them.Jim McBee - Blog - http://mostlyexchange.blogspot.com
November 10th, 2010 3:05pm
If the OS is 64-bit, and the app is 32-bit, references to HKLM\Software are redirected to HKLM\Software\WOW6432Node. If the app is 64-bit, or the OS is 32-bit, it should always use HKLM\Software (as far as I am aware). One question is how does the OS
determine the app is 32 or 64-bit.
Richard MuellerMVP ADSI
Free Windows Admin Tool Kit Click here and download it now
November 10th, 2010 6:09pm
Hi,
Thank you for your post here.
1.
Are these Windows 2008 and Windows 2008 R2 servers 32-bits or 64-bits?
2.
Which option do you choose when the application is compiled?
By default, .NET Framework applications have the platform target set to “Any CPU.” Host applications developed with this option selected can run 64-bit
code on a 64-bit operating system, and 32-bit code on a 32-bit operating system. The host application developer has the option to specify the platform target of x86 or x64 at compile time. If the x86 option is selected at compile time, the host application
will run it in 32-bit mode on a 64-bit operating system. If the x64 option is selected at compile time, the host application will run in 64-bit mode on a 64-bit operating system and will not run on a 32-bit operating system.
959944
POS for .NET Support on 64-Bit Editions of Microsoft Windows Operating Systems
http://support.microsoft.com/default.aspx?scid=kb;EN-US;959944
November 12th, 2010 5:00am
Hi Miles, thanks for the response. The last two times this has occurred has been on Windows Server 2008 R2. The development platform (for both the installer and the application is Windows Server 2003 x86). But I don't believe the
application is specifically compiled for either x86 or x64. The installer *always* creates the Registry key in the correct location.
So, my question is, why does the exact same build of this .NET application behave differently occasionally. Is there something in the way it is being installed? Or is there some mode in which IIS is running?Jim McBee - Blog - http://mostlyexchange.blogspot.com
Free Windows Admin Tool Kit Click here and download it now
November 12th, 2010 12:58pm
I finally did figure this out. Sometimes, when we were configuring the web application, the application was assigned to an Application Pool that was in "32-bit mode". On the Advanced Properties of the application pool, the "Enable
32-Bit Applications" setting was set to "True". Whenever this was set, the application tried to use the WOW6432node registry key instead of the standard reg key.
Jim McBee - Blog - http://mostlyexchange.blogspot.com
November 19th, 2010 3:05pm


