FuturShoc
Active member
I have put together a basic service which will need to read a particular registry key value. (It contains a path which is important to what it needs to do.)
Everything appears to be functioning on a basic level. I can install, start and stop the service just fine. And I can write out event log entries for it. My problem is that whenever add in a few lines of code to have the service read a registry key, it always fails to do so.
The service's "ServiceProcessInstaller1" property for "Account" is "LocalSystem". I've also tried changing this to "LocalService" and there was no change in behavior.
As far as I can tell, it seems to be a rights issue. The service, somehow, just can't "see" those registry keys.
NOTE: If I put that same registry-reading code into a basic form application, it reads the values perfectly.
I'm guessing there is something very subtle I haven't yet done in the service which would allow it to read those registry keys. Can someone point me in the right direction? I've been fighting this all afternoon and I'm about to go bald.
(I'm using Windows XP and VS .NET 2003)
Everything appears to be functioning on a basic level. I can install, start and stop the service just fine. And I can write out event log entries for it. My problem is that whenever add in a few lines of code to have the service read a registry key, it always fails to do so.
The service's "ServiceProcessInstaller1" property for "Account" is "LocalSystem". I've also tried changing this to "LocalService" and there was no change in behavior.
As far as I can tell, it seems to be a rights issue. The service, somehow, just can't "see" those registry keys.
NOTE: If I put that same registry-reading code into a basic form application, it reads the values perfectly.
I'm guessing there is something very subtle I haven't yet done in the service which would allow it to read those registry keys. Can someone point me in the right direction? I've been fighting this all afternoon and I'm about to go bald.
(I'm using Windows XP and VS .NET 2003)