Registry virtualization in Windows Vista 64 bits RRS feed

  • Question

  • Hi you, I am working in a C# application which needs to read some information below the hklm\software path in the registry. My C# application is configured as x86 as a requirement that I can not change because I use Microsoft Access which only has drivers for 32 bits. The operating system where I have this issue is Windows Vista 64 bits.

    The virtualization of Windows Vista is redirecting the query to hklm\software\... to a path inside of current user\....

    I have investigated some articles about how to disable registry virtualization for my application. The articles describe a typical solution that consists in add a manifest to my exe file. The manifest must include this content:


    According to these articles I have applied that workaround for my application. Nevertheless, it has not disabled the registry virtualization when I read the information in the registry.

    As other workaround that I found, I tested the reg.exe application with the flag "set dont_virtualize" to the registry path below hklm\software\ that I need to read. It did not help. The reg.exe tool says that the setting is set, but when I run my application, the virtualization continue working.

    When the C# application is set as AnyCPU, it works. When it is set as x86, it has the behavior that I have explained. I need that it works with the x86.

    I would like to know any workaround for this. Would it be a problem related with Windows Vista 64 bits? Is Windows Vista 64 bits producing that the described workarounds previously not work?

    I would appreciate a lot if somebody can help me with some ideas or some information to resolve this issue.

    I have been struggling with this problem, but I have not been able to resolve
    Tuesday, June 23, 2009 8:25 PM


  • This sounds like another virtualization at work, one that keeps the registry divided for 32-bit vs 64-bit apps.  A 32-bit app gets redirected to HKLM\Software\Wow6432Node.  That's not something you ought to fix, COM will stop working for example, but you could by P/Invoking RegDisableReflectionKey().

    Hans Passant.
    • Marked as answer by Zhi-Xin Ye Tuesday, June 30, 2009 1:23 PM
    Tuesday, June 23, 2009 10:04 PM