473,387 Members | 1,517 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

HKLM under Vista - how to get .NET app to read the real HKLM?

robains
I've got an App that normally is "Run as administrator" once deployed to a client PC running Vista.

Please don't go down the road of "you aren't supposed to do it that way, yada, yada, yada" as I really do NOT want to get into a heated debate about Microsoft implementation of security. I just want a solution I can live with.

While debugging my applications in VS 2005 (which is required to be set to "Run As Administrator") any references to Registry.LocalMachine.OpenSubKey don't appear to look in the "real" HKLM but look somewhere else (Virtualized key under the current user account is my guess).

How can I get my app (under VS 2005 debugging session) to look in the real HKLM dir under Vista x64.

I have tried setting up a manifest, but either I'm not getting it in the correct dir (thought it was supposed to be in Debug) or it's just not being used.

Note: my app is set to compile under x86 (32bit).

Thanks, Rob.
Oct 30 '07 #1
2 1258
Plater
7,872 Expert 4TB
Well I did a little reading (very little!) and saw this:
By convention, if similar data exists under CurrentUser and under LocalMachine, the data in CurrentUser takes precedence.
From what you're hypothesizing, it would seem that vista takes that literally and makes the .CurrentUser values override the .LocalMachine.

And now that I've only just restated your information, I don't know what else to offer.


Edit: And here's your confirmation:
http://bartdesmet.net/blogs/bart/arc...8/18/4167.aspx

And here:
http://www.thescripts.com/forum/thread627837.html
(which points out: http://msdn.microsoft.com/library/de...redirector.asp )
Oct 30 '07 #2
Thanks for getting back to me.

I've read the "VirtualStore" info and even created my registry key under that node but my VS 2005 VB.NET app still returns Nothing (keep in mind this works find when debugging in WinXP). It doesn't generate any exception error (this is important because that means it is not a permissions issue), it just doesn't find the reg key.

I've read those other articles also, but they don't really offer any solution.

I don't have any entries under HKCU so I'm not sure why "Nothing" (no entries) would override something that does exist in HKLM?

Bare in mind that if I compile and run my application (outside of the context of VS 2005 IDE) using "Run As Administrator" it does actually find the correct HKLM keys and works. It is ONLY under VS 2005 IDE when I'm debugging that I encounter this problem (also keep in mind that VS 2005 IDE is also launch using "Run As Administrator").

So at this point I have NO idea where Registry.LocalMachine.OpenSubKey is actually looking -- surely folks must have run into this problem??

I am retro fitting all my apps to no longer use any local resources on a client PC (i.e. don't write anything anywhere -- which is what Microsoft seem to want as they clearly can't deal with it) -- but in the mean time I need to resolve issues with existing .NET application that I debug under VS 2005 SP1 for Vista.

Anyone?

Rob.
Oct 31 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

56
by: Squishy | last post by:
I tried installing my VS2005 Pro on Vista Ultimate 32 bit RTM today and got errors stating that VS2005 was not compatible with Vista. Microsoft......please pull your finger out of my ass and tell...
20
by: raylopez99 | last post by:
Dvorak is always interesting, albeit speculative. What hidden gem has he found in Vista that helps developers? It can't be .NET/CLI, that's been out forever. RL Vista rollout hides reality...
6
by: j2ee.singh | last post by:
Hi, I'm looking to buy a new laptop primarily to learn & practice .NET and C#. My Question is: Is there any requirement for .NET and C# in terms of the following Operating Systems: -...
6
by: vovan | last post by:
I'm asking for help one more time. Below are 2 procedures. The first one is used in VB 2005 Windows Form project. It works fine on XP, Vista. Private Sub RegistryReadingTest() Try Dim f As New...
62
by: Tony Ciconte | last post by:
I have a rather complex commercial Acc2003 application (tab controls, 50K+ lines of VBA code, etc.) that will not run well at all on Windows Vista Ultimate. I have seen posts indicating that...
18
by: =?Utf-8?B?Tm9ybUQ=?= | last post by:
I have created a three tier application consisting of Client (Exe and Exe.Config), Middle (WebServices) and Database tiers. The Client tier contains an Exe, an Exe.Config and a dynamic Web...
11
by: Don | last post by:
QUESTIONS: 1. Has anyone figured out how to successfully install the Office 97 Pro Service Release 2 patch in Vista? 2. Has anyone successfully installed an Office 97 Pro CD (SR2 version) in...
3
by: Rob Latour | last post by:
The following snippet (vb.net 2005) is working just fine in xp but not in vista in xp it lists all related sub keys in the registry just fine. in vista it doesn't list certain ones (like...
4
by: Viviana Vc | last post by:
Hi all, I've read the WindowsVistaUACDevReqs.doc documentation and I have done different small tests on Vista to understand the bahaviour and now I have a few questions. 1) If I create a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.