How to build a x64, Windows 7 compatible application?
-
23-09-2019 - |
문제
We have an legacy application that accesses the registry. Because it is a 32bit application it accesses the registry in Windows 7 through Registry Virtualization when referencing HKEY_LOCAL_MACHINE\Software. My question is what setting(s) in Visual Studio do we need to modify to compile our applications where they access the registry "normally" without going through Registry Virtualization?
해결책 3
당신은 이것처럼 의미합니까?
$web = Get-SPWeb http:/SC/site
$web.WebTemplate + " " + $web.WebTemplateId
$web.close()
. 다른 팁
If you read the Registry Virtualization page closely, you will notice that the virtualization is not limited to 64-bit Windows. It only states that only 32-bit processes will be virtualized. But the virtualization is done on both 32- and 64-bit Vista and later. So the question title and the x64 tag are a bit misleading.
To answer your question, the same page says this: "Registry virtualization is disabled for the following: ... Processes that have requestedExecutionLevel specified in their manifests."
So you can disable the virtualization by adding a manifest file to your executable that specifies its execution level. There is at least a Microsoft KB article for how to do it in Visual Studio 2005: http://support.microsoft.com/kb/944276.
Why don't you use:
Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\...");
return (string)key.GetValue("blah");
and add access to the registry in the customtrust.config file.
or doesn't that work in Windows 7?