开发者

wonky behaviour vs2010 get HKLM value even with Run As Administrator c# .NET 4

For an application that will run as a windows service

I store settings values in a HKLM\Software... registry key.

I've a library that accesses my registry values.

I've a simple test console application that I use to verify that the code works.

To debug via my test console application, I must run vs2010 as administrator.

Everything works:

Console.WriteLine(WindowsRegistry.getTaleoOrgCode("test"));

invokes

Microsoft.Win32.RegistryKey hklmLocalMachineRoot =
Microsoft.Win32.Registry.LocalMachine;
Microsoft.Win32.RegistryKey hklmLocalMachineHbsiTaleoClient =
hklmLocalMachineRoot.OpenSubKey(@"SOFTWARE\Taleo\" + clientName.Trim(), false);
 // read only
if 开发者_运维问答(hklmLocalMachineHbsiTaleoClient != null)

via debug, it's clear that hklmLocalMachineHbsiTaleoClient is not null.

I have an application that uses the above library subroutine.

I start that application in vs2010 also as administrator.

via debug, it's clear that hklmLocalMachineHbsiTaleoClient is null.

Before debugging, I ensure that the failing application

has the latest version of my registry routines library.

The vs2010 Pro version is running under Windows 7.

Help, please and thank you.


Hans is right in his comment that the demon is registry virtualization.

Please see my follow up queestion:

https://stackoverflow.com/questions/4980211/how-do-i-search-all-non-virtual-and-virtual-registries-in-vista-win7-et-cetera

Thank you.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜